Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null in where clause
Message
From
22/02/2001 15:20:32
 
 
To
22/02/2001 14:16:38
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00478555
Message ID:
00478601
Views:
25
Ken,

How about:
WHERE (@dateparm IS NOT NULL AND mydatefield = @dateparm)
   OR (@dateparm IS NULL     AND mydatefield IS NULL)
?

HTH!

>assume: mytable.mydatefield - mydatefield can be null
>
>Is there any way that I can write in ONE where clause a statement to find all records in mytable where mydatefield 'equals' a passed in parameter, and that parameter can either be a date value or null?
Sylvain Demers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform