Re: date format
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 30 Jan 2007 14:43:57 -0700
On Tue, 30 Jan 2007 21:33:05 +0100, Jean-Paul De Winter
<jp.dewinter@xxxxxxxxxx> wrote:
Hi,
I have a table with a field called "Datum"
Here the date of records are stored in format DD/MM/YYYY
Not really. The date is *STORED* as a Double Float number, a count of
days (and fractions of days, if you have a time portion) since
midnight, December 30, 1899. The Format assigned to a field only
controls how it is *displayed*, not what's stored.
In my code I wrote:
Dim Starten as Date
Dim SQL as string
then in the code itself I wrote:
sql = "SELECT Agenda.datum FROM agenda WHERE Agenda.datum=#" & starten "#;"
This returns
SELECT Agenda.datum FROM agenda WHERE Agenda.datum=#5/12/2005#;
No record is found because finally access seems to look for dates in the
format MM/DD/YYY
What to do?
Use the American mm/dd/yyyy format, or an unambiguous format such as
dd-mmm-yyyy or yyyy.mm.dd; for instance,
sql = SELECT Agenda.datum FROM agenda WHERE Agenda.datum=#" & _
Format(starten, "mm/dd/yyyy") & "#;"
John W. Vinson[MVP]
.
- Follow-Ups:
- Re: date format
- From: Jean-Paul De Winter
- Re: date format
- References:
- date format
- From: Jean-Paul De Winter
- date format
- Prev by Date: Re: In([variable])
- Next by Date: Null to Zero in a crosstab
- Previous by thread: date format
- Next by thread: Re: date format
- Index(es):
Relevant Pages
|
|