American Dates

  • Thread starter Thread starter nathan_savidge
  • Start date Start date
N

nathan_savidge

Hi,

I have created a database, that needs to have any creations/edits/deletions
passed to an audit table. I am fine with coding this. However, i have just
coded the form to display the audit table, and i have noticed that the SQL
Append statement that i am using in VBA to append details to the Audit Table
puts the dates in american format. Can anyone advise on how to reverse this
back to UK dates.

Regards.
 
Not a problem,

You format the date in reverse before you pass the SQL command.

So mine was

dtDateDiary = format(rst.fields("Diary_date"),"mm/dd/yyyy hh:mm:ss")

you dont need the hhmmss if you dont want to record time.

Hope this helps

Nathan.

NoCanDo said:
nathan_savidge said:
FIXED IT NOW.
[quoted text clipped - 6 lines]


Hi Nathan

Glad to know you fixed it, but could you possibly share your solution, as I'm
having a smilar problem too.

Kind regards

NoCanDo
 
NoCanDo said:
nathan_savidge said:
FIXED IT NOW.
[quoted text clipped - 6 lines]


Hi Nathan

Glad to know you fixed it, but could you possibly share your
solution, as I'm having a smilar problem too.

Kind regards

Dates are not stored in any format. Format affects display only.

Now, if what you mean us that you are creating SQL statements or queries
that use date literals and the results that get stored are incorrect then
that is because you are using the wrong format for your date literals.

Date literals in Access must be in US formats (mm/dd/yy, mm/dd/yyyy) OR in a
non-ambiguous format (one that uses alpha characters for the month for
example), OR the ISO format yyyy-mm-dd. Even the middle option can be a
problem when using different language versions of Access or Windows. ISO is
your safest choice here.

What confuses people is that the Euro format of dd-mm-yyyy *sometimes*
works. It works when the dd is greater than 12 which allows Access to
"know" that those digits must represent the day rather than the month. Any
time the dd portion is 12 or less Access will always assume US format and
use that value for the month.
 
Back
Top