Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparing dates X, Y when X or Y could sometimes be blank

Status
Not open for further replies.

kev510

Programmer
Jul 12, 2006
61
Hello everyone,
I am trying to compare two dates while one of them could sometimes be blank. One date is stored in a table as smalldatetime, and the other will be entered in mm/dd/yyyy format in a text box.

I want an action to occur if the date are different (1/1/2000 compared to 5/5/2005), or when comparing one null to an actual date (example: NULL in the table, 1/1/2000 in the text box)

I tried using many functions, and they all cause an error when one value is null. Thanks for your time!
 
Did you try the IsNull function?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
IsNull?
How and where would I use that?
(I'm a newbie programmer, can you tell?)
 
If Not IsNull(datStart) Then

End If

same thing when looping through recordset stuff

If IsVariant()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top