Cdate vs Isdate

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone please tell me the difference between cdate and isdate and when
to use or when not to use anyone of them...

Thanks!
 
Use the IsDate() function to test if something can be interpreted as a date.
Example:
If IsDate(Me.[Text1]) Then
MsgBox "Okay, that can be understood as a date."
End If

Use CDate() to force Access to treat something as a date (typecast).
For an example, see:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
 
Thank you that was very helpful!

Allen Browne said:
Use the IsDate() function to test if something can be interpreted as a date.
Example:
If IsDate(Me.[Text1]) Then
MsgBox "Okay, that can be understood as a date."
End If

Use CDate() to force Access to treat something as a date (typecast).
For an example, see:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

JOM said:
Can someone please tell me the difference between cdate and isdate and
when
to use or when not to use anyone of them...

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top