By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,521 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,521 IT Pros & Developers. It's quick & easy.

Date problem with not american format

P: n/a
hi,

i have to use an existing Access 2000 database with datetime fields in
this format under VB6:
- dd/mm/yyyy hh:nn:ss
- The operating system format is dd/mm/yyyy

I have to compare in my SQL like this (include date and time in the
same field)
Start_TimeStamp <= #" & DateAdd("n", gudt_App.iAlarm_BeforeMinutes,
Now) & "#"

the problem is that 'Start_TimeStamp' value is the 7 january and is
recognized like the 1st july...
I took a look to many posts here, but i didn't found how to do with an
existing database, can you help me ?

Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Regardless of what your regional settings are, you must use mm/dd/yyyy
format (or an unambiguous one such as dd mmm yyyy or yyyy-mm-dd) in your SQL
if you're going to use the # delimiters.

Try:

Start_TimeStamp <= " & Format(DateAdd("n",
gudt_App.iAlarm_BeforeMinutes,Now), "\#mm\/dd\/yyyy\#")

You might find it useful to read Allen Browne's "International Dates in
Access" at
http://members.iinet.net.au/~allenbrowne/ser-36.html or what I have at
http://members.rogers.com/douglas.j....artAccess.html

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Station Media" <go****@easycolorthemes.com> wrote in message
news:5c**************************@posting.google.c om...
hi,

i have to use an existing Access 2000 database with datetime fields in
this format under VB6:
- dd/mm/yyyy hh:nn:ss
- The operating system format is dd/mm/yyyy

I have to compare in my SQL like this (include date and time in the
same field)
Start_TimeStamp <= #" & DateAdd("n", gudt_App.iAlarm_BeforeMinutes,
Now) & "#"

the problem is that 'Start_TimeStamp' value is the 7 january and is
recognized like the 1st july...
I took a look to many posts here, but i didn't found how to do with an
existing database, can you help me ?

Thanks

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.