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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting a date format

Status
Not open for further replies.

tpowers

Technical User
Nov 2, 2002
153
US
I have a form with 2 date fields. I have the users entering in the data in the format of mm/dd/yy, but I need to convert the dates in to yyyymmdd so that the database can understand it.

does anyone know how I would do this?

Thank you in advance,

TPowers

P.S. I am using Access 2002
 
format(YourData,"yyyymmdd") have to work
 
Tpowers, there is a flaw in your ointment.

Date fields have no specific format, and the database SHOULD be able to understand almost any date intput format, and then will also be able to output your date in any format.

It's wasted effort to REQUIRE a date input in any form - as long as it's a valid date, the engine will convert it to the serial number that date represents. So even though you might like to SEE your dates displayed "20030426", if the field is defined as a DATE field, you can put the following values into it, and they will ALL work just fine:


4/26/03
Apr 26 (always defaults to current year)
26 apr 03
04/26/2003
4-26-2003
4 26 03


and so on. Don't REQUIRE your user to input the date in any particular format. As long as it's a real date, it will go in just fine, and Access will do everything else for you.

Jim






Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top