Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 t-sql: using CASE in a where clause

Author  Topic 

C0dewarr10r
Starting Member

3 Posts

Posted - 2004-12-14 : 16:29:05
I am unable to get the correct syntax when returning value is compound statement(the following code is in a stored procedure)
ie ...
where id = @id and
name = @name and...

CASE
when @dateQualifier = 'eq' then dateCreated = @DateCriteria
when @dateQualifier = 'lt' then dateCreated < @DateCriteria
when @dateQualifier = 'gt' then dateCreated > @DateCriteria
end

Thanks

Mark

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2004-12-14 : 16:32:38
Hey, now! This looks exactly like http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=43717

Is this some sort of homework assignment? Are you two consultants on the same project? What's up with this?

-----------------------------------------
Professional IT Solutions from Infoneering
Go to Top of Page

timgaunt
Posting Yak Master

115 Posts

Posted - 2004-12-14 : 16:37:21
gaga thats absolutley amazing haha, fancy that hahaha. Nope, I'm just learning some SQL techniques on my local server at home haha using the database that I wrote here hahaha, I'm stunned haha
Go to Top of Page

C0dewarr10r
Starting Member

3 Posts

Posted - 2004-12-15 : 08:16:34
Nope, I am trying to determine how I can perform search criteria based on a multitude of parameters as well as qualifiers. The query I submitted is the simplifier version on what I am trying to achieve.
Go to Top of Page
   

- Advertisement -