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

Date Format Problem

P: n/a
I am struggling with a problem that should be easy to solve it but has me
stumped. I am writing data to a table using ADO and writing the date to this
table.

I have a calendar control on the form that allows me to choose the date. I
also have a procedure on the OnLoad event of the form to set
a data variable to NOW(). If I don't want to change this I simply write
this variable to the table.

The trouble is it insists of switching the DD and MM around. It displays on
the screen dd/mm/yy but when it is written to the table it is mm/dd/yy.

How can I stop this from happening?

Mike
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"mike" <re******@hotmail.com> wrote in message
news:3f******@dnews.tpgi.com.au...
I am struggling with a problem that should be easy to solve it but has me
stumped. I am writing data to a table using ADO and writing the date to this table.

I have a calendar control on the form that allows me to choose the date. I
also have a procedure on the OnLoad event of the form to set
a data variable to NOW(). If I don't want to change this I simply write
this variable to the table.

The trouble is it insists of switching the DD and MM around. It displays on the screen dd/mm/yy but when it is written to the table it is mm/dd/yy.

How can I stop this from happening?


IIRC you can't. The Jet database engine requires dates to be in US format,
so Access will accept date input and display dates according to your locale
settings but converts to US format for storage.

HTH

Peter
Nov 12 '05 #2

P: n/a
On Fri, 3 Oct 2003 17:15:30 +1000, "mike" <re******@hotmail.com>
wrote:
How can I stop this from happening?


Look here:
http://www.mvps.org/access/datetime/date0005.htm

When you're making an SQL-statement in code access is expecting the
date to be in the US-format.
--
bebelino
Nov 12 '05 #3

P: n/a
Thanks for this. Problem is now solved.

"bebelino" <a.*@c.d> wrote in message
news:vt********************************@4ax.com...
On Fri, 3 Oct 2003 17:15:30 +1000, "mike" <re******@hotmail.com>
wrote:
How can I stop this from happening?


Look here:
http://www.mvps.org/access/datetime/date0005.htm

When you're making an SQL-statement in code access is expecting the
date to be in the US-format.
--
bebelino

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.