Problems with Dates

  • Thread starter Thread starter Roger Hembury
  • Start date Start date
R

Roger Hembury

Hi

I have a slight problem saving dates to a table from some ASP code.

The SQL looks like this -

INSERT INTO SCHEDULE (dtDate, dtTime, sPerson, mEvent) values(
#10/01/05#,#08:00#,'Mr X','Dentist')

but in the table Access (have 2002 but database is in 2000 format) has
converted the date to 01/10/05 which is really really annoying and I can see
no reason as to why it is doing this.

Why is it doing this and is there a way of correcting this? I have checked
all the dates, keyboard and international settings and everything is set to
UK.

TIA

Roger
 
Roger Hembury said:
Hi

I have a slight problem saving dates to a table from some ASP code.

The SQL looks like this -

INSERT INTO SCHEDULE (dtDate, dtTime, sPerson, mEvent) values(
#10/01/05#,#08:00#,'Mr X','Dentist')

but in the table Access (have 2002 but database is in 2000 format) has
converted the date to 01/10/05 which is really really annoying and I can see
no reason as to why it is doing this.

Why is it doing this and is there a way of correcting this? I have checked all
the dates, keyboard and international settings and everything is set to UK.

Hard-coded dates in Access SQL MUST be US format or ISO (yyyy-mm-dd) or a format
where alpha characters are used in the month.
 
Hi Roger,

SQL queries read date format in "American English", I mean, month/day/year.

So, when you enter values(#10/01/05#,#08:00#,'Mr X','Dentist'), it will be
understood as 01/October instead of 10/January.

Luiz Cláudio
 
For more info., see the long thread "Varying date formats" started about 16
hrs ago in the "Forms" newsgroup newsgroup.
 
Hi Van,

Thanks for pointing me in the right direction.

Looks like for SQL everything needs to be in US format. Strange way of doing
it but then every language / program has it own little quirks.

Thanks again

Roger
 

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

Back
Top