Article View: borland.public.cppbuilder.database.ado
Article #3492Re: Can't access database with the date data type field
From: Vassiliev V.V.
Date: Sun, 11 Aug 2002 07:53
Date: Sun, 11 Aug 2002 07:53
70 lines
2571 bytes
2571 bytes
When you specify the criteria argument, date literals must be in U.S.
format, even if you are not using the U.S. version of the MicrosoftR Jet
database engine. For example, May 10, 1996, is written 10/5/96 in the United
Kingdom and 5/10/96 in the United States. Be sure to enclose your date
literals with the number sign (#) as shown in the following examples.
To find records dated May 10, 1996 in a United Kingdom database, you must
use the following SQL statement:
SELECT *
FROM Orders
WHERE ShippedDate = #5/10/96#;
You can also use the DateValue function which is aware of the international
settings established by Microsoft WindowsR. For example, use this code for
the United States:
SELECT *
FROM Orders
WHERE ShippedDate = DateValue('5/10/96');
And use this code for the United Kingdom:
SELECT *
FROM Orders
WHERE ShippedDate = DateValue('10/5/96');
Regards,
Vassiliev V.V.
http://www.oledbdirect.com
"Jackie" <tkfi@hotmail.com> �������/�������� � �������� ���������:
news:3d55a14f$1_2@dnews...
> Hi All
> I have a Access database with several table which all have a (short date
> format) data type field , where i try to query it by execute the following
> SQL statement .
>
> Select * from table1 where dater = 31/7/2002
> or
> Select * from table1 where dater = '31/7/2002'
> or
> Select * from table1 where dater = #31/7/2002#
>
> I got nothing , I'm sure that at least one record have the date
"31/7/2002".
> did i do something wrong.
>
> Please help
> Thanks a lot
>
>
>
>
>
>
Technical Details
Message-ID:
<3d561d34_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mailReferences:
<3d55a14f$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,47a4773167bac670 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-08-11 01:24:14 PST From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> Newsgroups: borland.public.cppbuilder.database.ado References: <3d55a14f$1_2@dnews> Subject: Re: Can't access database with the date data type field Date: Sun, 11 Aug 2002 11:53:30 +0400 Lines: 72 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 62.118.133.29 Message-ID: <3d561d34_1@dnews> X-Trace: dnews 1029053748 62.118.133.29 (11 Aug 2002 01:15:48 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail