Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using NULL with datetime fields
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00541524
Message ID:
00541557
Vues:
24
And the answer is...

iif(empty(table1.rdate),'NULL',transform(rdate))

it is the keyword NULL not a string so don't put quotes around it.



>I am trying to follow the advice here to use nulls with datetime fields, but let's say a null comes over and I do a:
>set nulldisplay to " / / " since I will not have nulls except for these dates.
>
>Then when I go to save some dates back to SQLServer2K that are still null, I can do an update with a value like:
>iif(empty(table1.rdate),???,transform(rdate))
>but what do I put for ??? to get a null put back into SqlServer?
>
>I could just add logic that would not try to update that field if my value is null for a date, thus leaving it null, but the logic is complex for the number of fields involved and so it would be simpler if there was a null value for a datetime field. How do I do a ctrl-0 in code?
>
>In this app it is important whether dates are empty or not, as it controls the flow of the order development towards shipment.
>
>TIA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform