Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Null in where clause
Message
De
22/02/2001 15:20:32
 
 
À
22/02/2001 14:16:38
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00478555
Message ID:
00478601
Vues:
23
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform