473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Date Format Problem

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
3 8330
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: amith | last post by:
hi I have written javascript for comparing two dates in US format and finding out whether the start date is greater than the end date and vice versa. In this attempt i have instantiated the...
6
by: Dario Di Bella | last post by:
Hi all, we have the following urgent issue affecting our development team. Initially we had one particular workstation that failed executing queries on a DB2 database, raising an invalid date...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
16
by: Mik | last post by:
I apologise if this post seems a little basic, but I am a newbie and have NO access knowledge. I have downloaded the Accounts Ledger from the Microsoft Website. It allows the user to review a...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
4
by: OzNet | last post by:
I have some functions to calculate the working days in a given period. This includes a table that is queried to calculate the number of public holidays that don’t occur on a weekend. If I test...
11
ollyb303
by: ollyb303 | last post by:
Hello, I am using a dynamic crosstab report to track performance statistics for my company and I have hit a problem. I would like the option to track stats daily (for the last 7 complete...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.