How to check if date is null
hi :wave:
this is my code, and its not working,the way it should be
Code:
Code:
if rs!start_ded=0 then
exit sub
else
rs!start_ded=format(now,"mm/dd/yyyy")
what i want is to check if the rs!start_ded empty then do nothing else format(now,"mm/dd/yyyy"). i don't know what to put in if rs!start_ded=0
thanks!
Re: How to check if date is null
pick a record you know has an empty date and return the field to a messagebox or something
Re: How to check if date is null
yes as westconn1 told you return a record from your database and check it's value when date is empty to know what is it's format...Once done, you can compare it easily
For example in vb if you declare a date variable and you want to check if it's empty or not, you can do something like
vb Code:
if MyDate = "00:00:00" then
msgbox "Empty Date"
Else
msgbox "Not Empty"
End if
In your case you'd better check what are the values of empty dates in your database and then you make comparaison
Re: How to check if date is null
Code:
if IsNull(rs!start_ded) then
Re: How to check if date is null
Or
vb Code:
If Not IsNull(rs!start_ded) Then
rs!start_ded=format(now,"mm/dd/yyyy")
End If