Click here to Skip to main content
15,910,471 members
Home / Discussions / Database
   

Database

 
AnswerRe: sql query - eliminate all duplicates but one Pin
SeMartens7-May-09 1:36
SeMartens7-May-09 1:36 
QuestionODBC connection thrugh PERL Pin
Ivan20096-May-09 7:19
Ivan20096-May-09 7:19 
Questionproblem related to insert query Pin
nazimghori6-May-09 5:34
nazimghori6-May-09 5:34 
AnswerRe: problem related to insert query Pin
Mycroft Holmes6-May-09 14:42
professionalMycroft Holmes6-May-09 14:42 
QuestionRe: problem related to insert query Pin
nazimghori6-May-09 17:49
nazimghori6-May-09 17:49 
AnswerRe: problem related to insert query Pin
Mycroft Holmes6-May-09 18:06
professionalMycroft Holmes6-May-09 18:06 
AnswerRe: problem related to insert query Pin
AlexeiXX37-May-09 8:11
AlexeiXX37-May-09 8:11 
QuestionParameter problems Pin
Shrimpersfan6-May-09 4:00
Shrimpersfan6-May-09 4:00 
Hi there.

I have the following stored procedure:

/**********************************************/
CREATE PROCEDURE sp_iet_ComplaintReport

@StartDate DATETIME,
@EndDate DATETIME

AS

select
co.ComplaintID,
pli.Description AS RegardingDD,
co.DateRaised,
c._accCustomercode,
rtrim(c.firstnames) + ', ' + rtrim(c.lastnames) as Name,
CASE
WHEN co.BeenRead = 0 THEN 'Open'
WHEN co.BeenRead = 1 THEN 'Completed'
END AS Status,
rtrim(u.fullname) as handler

from
complaint co
inner join
contact c on
co.contactid = c.contactid
inner join
adm_picklistitem pli on
co.regardingdd = pli.localcode and
pli.picklistname = 'complaintlist'
left outer join
adm_user u on
co.handler = u.userid
where
co.dateraised >= @startdate and co.dateraised <= @enddate

GO
/*********************************************/

This works fine but i want to be able to pass @Handler and map that to the complaint.Handler field. The thing that i want is if i pass NULL to the @Handler then it should bring back all Complaint.Handlers but if you pass an actual value to @Handler then this should bring back a matching value (if it exists).

Sorry if I have worded poorly.

Any help would be greatly appreciated.
AnswerRe: Parameter problems Pin
Mycroft Holmes6-May-09 14:40
professionalMycroft Holmes6-May-09 14:40 
Questionhelp on sql CE update Pin
zigzagooo5-May-09 23:01
zigzagooo5-May-09 23:01 
QuestionOracle dynamic sql OPEN-FOR won't take SQL string in form of a string variable Pin
devvvy5-May-09 18:07
devvvy5-May-09 18:07 
QuestionWhat would be the best front-end RAD software? Pin
el_pablo5-May-09 15:05
el_pablo5-May-09 15:05 
QuestionWhich flavor of SQL Server to use Pin
Hypermommy5-May-09 7:48
Hypermommy5-May-09 7:48 
AnswerRe: Which flavor of SQL Server to use Pin
Luc Pattyn5-May-09 8:47
sitebuilderLuc Pattyn5-May-09 8:47 
AnswerRe: Which flavor of SQL Server to use Pin
Eddy Vluggen6-May-09 2:41
professionalEddy Vluggen6-May-09 2:41 
QuestionDatabase design question Pin
AlexeiXX35-May-09 7:15
AlexeiXX35-May-09 7:15 
AnswerToo normalized ? Pin
David Mujica5-May-09 8:27
David Mujica5-May-09 8:27 
GeneralRe: Too normalized ? Pin
Mycroft Holmes5-May-09 14:56
professionalMycroft Holmes5-May-09 14:56 
GeneralRe: Too normalized ? Pin
AlexeiXX37-May-09 7:59
AlexeiXX37-May-09 7:59 
GeneralRe: Too normalized ? Pin
Mycroft Holmes7-May-09 14:22
professionalMycroft Holmes7-May-09 14:22 
GeneralRe: Too normalized ? Pin
AlexeiXX37-May-09 7:47
AlexeiXX37-May-09 7:47 
GeneralGlad to Help Pin
David Mujica7-May-09 7:56
David Mujica7-May-09 7:56 
QuestionSQL SERVER Pin
vasini5-May-09 4:07
vasini5-May-09 4:07 
AnswerDivide and conquer Pin
David Mujica5-May-09 5:11
David Mujica5-May-09 5:11 
GeneralRe: Divide and conquer Pin
vasini5-May-09 7:53
vasini5-May-09 7:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.