473,386 Members | 1,779 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,386 software developers and data experts.

US and UK dates confused

Hi,
I have spent some time trying to sort out a date problem (see mail an hour
or so ago) and am now getting to see what the problem is.

If I present today's date as 07/02/2004 in a search it come up as 02/07/04.
as a consequence I can't get the right record selected. How do i ensure all
references to dates are as in UK? My PC is ... I think correctly set up.

This has driven me round the bend!!

Thanks in advance

John M
Nov 12 '05 #1
4 1901
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:c0*******************@news.demon.co.uk...
Hi,
I have spent some time trying to sort out a date problem (see mail an hour
or so ago) and am now getting to see what the problem is.

If I present today's date as 07/02/2004 in a search it come up as 02/07/04. as a consequence I can't get the right record selected. How do i ensure all references to dates are as in UK? My PC is ... I think correctly set up.

This has driven me round the bend!!

Thanks in advance

John M

If you are designing queries using the Access GUI, then you can write dates
in dd/mm/yyyy and provided your PC is set up correctly, then these will be
interpreted and adjusted accordingly (have a look at the SQL generated for
your query). However, when you are writing code you are simply supplying a
string, and no attempt is made to convert this based on regional settings.

You could simply format the date when you create the WHERE clause

strWhere = "WHERE MyDate = #" & Format(dteDate, "mm/dd/yyyy") & "#"

or use a function such as DateSerial which is great for returning
unambiguous dates.

Fletcher
Nov 12 '05 #2
John M wrote:
Hi,
I have spent some time trying to sort out a date problem (see mail an hour
or so ago) and am now getting to see what the problem is.

If I present today's date as 07/02/2004 in a search it come up as 02/07/04.
as a consequence I can't get the right record selected. How do i ensure all
references to dates are as in UK? My PC is ... I think correctly set up.


May be; but Access (Jet, actually) uses US date format. Live with that
(I do) and maybe format your dates with format(yourdate, "mm/dd/yyyy")
in the queries.

--
Bas Cost Budde
http://www.heuveltop.nl/BasCB

Nov 12 '05 #3
"John M" <jo**@jmawer.demon.co.uk> wrote in
news:c0*******************@news.demon.co.uk:

If I present today's date as 07/02/2004 in a search it come up as
02/07/04. as a consequence I can't get the right record selected. How
do i ensure all references to dates are as in UK? My PC is ... I think
correctly set up.


Access handles dates as UK dates if you write "really stubborn and perverse"
in front of each. If you want a civilized, consistent, widely understandable
approach try standardizing to "yyyy-mm-dd".

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #4
Lyle Fairfield wrote:
If you want a civilized, consistent, widely understandable
approach try standardizing to "yyyy-mm-dd".


I recognize ISO!
--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Peter Pfeiffer | last post by:
I've written several scripts that have "while" blocks which increment a date by one day if the date does not match one of a group of dates. However, sometimes it apparently steps out out the while...
3
by: Cillies | last post by:
Does anyknow how to control dates in acess 2000, the thing is I want to search for records using a form by date. I will be using a between date search box. But i want to enter say todays date but...
1
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
0
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
36
by: Lindie | last post by:
The more I read the more confused I get. Too much on dates calulations in the groups. I need to know how often a book has been loaned out over the past year- 52 weeks. My table has Book...
13
by: tshad | last post by:
I have a dataset with a date in it. The type is smalldatetime on Sql Server and I am just doing a "SELECT * from x" to get it. All my other fields are fine, but this one gives me an error of: ...
15
by: @sh | last post by:
For some reason guys my SQL string isn't working and I'm probably doing something stupid? SELECT * FROM sol_session SELECT * FROM SOL_Session WHERE DateGiven...
4
by: Michael Sharman | last post by:
Hi guys, I'm a little confused with dates. Ok, all I want to do is store a date in MySQL as a datetime object and be able to read and format it using PHP. My datatype in MySQL is DATETIME and...
6
by: Lewe22 | last post by:
On button click, what i'm trying to do is (in steps) Find Current Date Return First Date of Current Month (Eg: 10/06/2008 would become 01/06/2008) Use in a query to pull out .Reflect in a...
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: 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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.