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

Day() & Month() functions return other's info

Status
Not open for further replies.

Zycmi

IS-IT--Management
Jun 19, 2002
42
CA
Hi,

I've tried using the Day() & Month() functions as well as the DatePart function, I've noticed that the DAY and MONTH values are sometimes switching from one-another.

In the event that the date is sent as yyyy/mm/dd, the functions return the correct values, however, if the date string is formatted differently, the day and month values are often switched. It has even happened that my year gets switched. Is there a way to grab the day, month and year from a string correctly every time, regardless of what format it comes in as?

Thanks,
Zycmi
 
control the input...try having the user choose from three drop downs (month, day, year) rather than a textbox to ensure data is the same each time...dates are always problematical as differing areas enter dates differently...

ie USA date mm/dd/yyyy
EUR date yyyy/mm/dd

also depends on storage used...ms access can only store mm/dd/yyyy formats by default...silly 'mericans doing silly stuff... Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top