Date dd/mm/yyyy problem

A

Andre Gibson

Hello al

My office recently insisted that we adjust our date format to dd/mm/yyyy (I live in the Bahamas. Things are done alittle differently) Anyways I assumed that this would in no way affect my vb app that connect to a access db , but I was wrong

After some investigation, I have narrowed the problem down to my access db. I am running Microsoft Access 2002 SP-1.(and searching updates now.)

I created a query that should return all record up to the 2/12/2003 (2 Dec, 2003). The system however evaluated this as Feb 12 2003, and since there were no records around that time, it returned nothing

I then switch up and searched for records up to 12/2/2003 (this according to my system should be 12 Feb 2003). The system however returned everything up to the 2 Dec 2003

Is there an internal setting in access that I need to adjust in order for this to work properly?
Any help you could offer would be greatly appreciated

Thanks
 
V

Van T. Dinh

Generally, literal dates in SQL Strings must be in US format (mm/dd/yyyy)
and enclosed in hashes like

#12/02/2003# 2/Dec/2003

for JET to interpret correctly regardless of the country settings of your
OS.

--
HTH
Van T. Dinh
MVP (Access)



Andre Gibson said:
Hello all

My office recently insisted that we adjust our date format to dd/mm/yyyy
(I live in the Bahamas. Things are done alittle differently) Anyways I
assumed that this would in no way affect my vb app that connect to a access
db , but I was wrong.
After some investigation, I have narrowed the problem down to my access
db. I am running Microsoft Access 2002 SP-1.(and searching updates now.)
I created a query that should return all record up to the 2/12/2003 (2
Dec, 2003). The system however evaluated this as Feb 12 2003, and since
there were no records around that time, it returned nothing.
I then switch up and searched for records up to 12/2/2003 (this according
to my system should be 12 Feb 2003). The system however returned everything
up to the 2 Dec 2003.
 
D

Douglas J. Steele

In addition to Van's comment (which is absolutely correct), you may want to
take a look at Allen Browne's "International Dates in Access" at
http://members.iinet.net.au/~allenbrowne/ser-36.html


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Andre Gibson said:
Hello all

My office recently insisted that we adjust our date format to dd/mm/yyyy
(I live in the Bahamas. Things are done alittle differently) Anyways I
assumed that this would in no way affect my vb app that connect to a access
db , but I was wrong.
After some investigation, I have narrowed the problem down to my access
db. I am running Microsoft Access 2002 SP-1.(and searching updates now.)
I created a query that should return all record up to the 2/12/2003 (2
Dec, 2003). The system however evaluated this as Feb 12 2003, and since
there were no records around that time, it returned nothing.
I then switch up and searched for records up to 12/2/2003 (this according
to my system should be 12 Feb 2003). The system however returned everything
up to the 2 Dec 2003.
 
A

Andre Gibson

Hey guys,

Thanks so much for clearing that up for me. I've been beatin my head against a wall for quite some time trying to figure this out. Now that I understand what happening I will make code adjustment to rectify the problem.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top