Trouble With Dates

databasedonr

Registered User.
Local time
Today, 15:42
Joined
Feb 13, 2003
Messages
163
Greetings:

I have developed a database that is mostly working -- in Access2000 running on W2K.

The database allows users to select a vehicle from a pool and book that vehicle for certain dates.

The issue I have is with the date settings and the regional settings on the computers. About 40 of the users in my department use an application that requires a specific date setting -- it is yyyy/mm/dd. The rest of us (and esp. my database app) use either mm/dd/yyyy or dd/mm/yyyy.

The users enter a date on a form that is configured as Medium date, and I take this and write the entered date into a variable, and then call this variable to write the date into a SQL insert statement when the vehicle is booked.

It works perfectly for everyone except the users with the regional settings for yyyy/mm/dd.

Is there any way I can grab the regional settings, and if the users has the "bad" setting, run a separate query to accommodate the date format? The problem is compounded, as I also check the table where the cars are checked out when looking at the vehicles available for booking - and if the dates aren't read correctly, then I can have cars reporting as available when they are already booked out.

Any help is gratefully accepted.

Thanks in advance.
 
In case you're wondering

As it turns out, my problem was not dissimilar to other posts here, so I apologize, but I found a couple of pratfalls that might be worth sharing:

First, I made the grevious error of writing the dates from my form to a variable field using FieldName.Text as opposed to FieldName.Value. This is very bad, and contributed to my problems.

Once I found that, the dates would cast properly unless the Regional Options Country was changed -- I happen to work in an environment where English (UK), English (US) and English (Canada) are all selected. Once these are changed, it does create problems interpreting the dates, which I resolved by formatting the date in the SQL String as such: Format$(mydatestring, "dd\/mm\/yyyy\/")

Sorry if my post caused much rolling of the eyes, but hopefully my experience helps someone else in similar straits.

Cheers
 

Users who are viewing this thread

Back
Top Bottom