Link to home
Start Free TrialLog in
Avatar of TimSweet220
TimSweet220

asked on

Check Date formats before updating database

What is the best way to check for formatting of dates in a vb form before it get send to the db?

I was considering the text change on the field, but not sure that's the best way.

Code sample would be great.

Thanks in advance.

Tim
Avatar of apresto
apresto
Flag of Italy image

Hi TimSweet220,

do you want to check the format or check the date is valid?

you could just check it is valid and then strip it into the format you want:

If IsDate(strDate) then
    //Do something
Else
   //not valid date
End If


Apresto
the universally accepted date format is yyyy/mm/dd, i would recommend you use that format
ASKER CERTIFIED SOLUTION
Avatar of ZeonFlash
ZeonFlash

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial