INSERT/UPDATE Date in Access problem...

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

Yhis is a problem that everybody knows I guess: When you INSERT our UPDATE a
date in an Access-database half of the time you date changes.
For example: you want to input two dates: 13th of May (13/05/2003) and 12th
of May (12/05/2003). The first one will always be in the database as
"13/05/2003" because the database knows 13 can't hbe a month. But for the
second oen you need to get lucky: there's always a big chance (depending on
the regional serttings?) that he will put it in the database as "05/12/2003"
and thinks it is 5th of December instead of 12th of May.

I used to have this problem in VB6, and now again I have it in VB.NET. In
VB6 I found solutions like insertign the date as MM/dd/yyyy instead of
dd/MM/yyyy.

But still I think this isn't a 'nice' way. There should be a way which is
independed of regional settigns etc, and doens't force you to use 'trics'.
Does anybody here know how to do this?

Thanks a lot in advance!

Pieter
 
DraguVaso said:
When you INSERT our UPDATE a date in an Access-database half
of the time you date changes.

Use an unambiguous date format when you pass the data to Access,
like "yyyy-mm-dd" or "dd mmm yyyy". That way, Access /can't/ be
"clever" and mess up your dates.

HTH,
Phill W.
 
Back
Top