473,406 Members | 2,352 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,406 software developers and data experts.

date format mm/dd/yyyy or dd/mm/yyyy

it's the idiot with his query strings again...."yippeee" I hear aaron shout

this time the problem is with a date format query

I have a query string thus

strSQL = "SELECT * FROM users where creation_date >= #" & strthisweekstart &
"# AND creation_date <= #" & strthisweekend & "#"

strthisweek start is dateadd("d",-7,date) and strthisweekend is date(). The
idea is it shows the records that were added in the last week

so a week ago a response.write of this gave

SELECT * FROM users where creation_date >= #31/12/2004# AND creation_date <=
#7/01/2004#

and I thought everything was fine as I got the correct number of records

today I check again and I get the result of zero records, I know this is
wrong..so another response.write and I get

SELECT * FROM users where creation_date >= #07/01/2004# AND creation_date <=
#14/01/2004#

which *appears* right only it seems that the first date is in the format
mm/dd/yyy and the second is dd/mm/yyyy

I've checked this by creating a record with the creation date of 14/06/2004,
the query then returns correctly, 1 record

so, the pages are interpreting anything that CAN be in the format of
mm/dd/yyyy as such and anything that can't be this format is interpreted as
dd/mm/yyyy

where do I tell the pages which date format to use for ALL dates?

bearing in mind I'm in the UK and my windows settings are in UK format
(dd/mm/yyyy), which I thought would automatically set the correct format.

thanks
Jul 19 '05 #1
3 3372
hi,
could you use only yyyy/mm/dd ??
if this is possible you have always invert you dates, else
you have treat each case before make a search.
bye

--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
"Alistair" <news@*remove*alistairb.co.uk> escreveu na mensagem
news:10************@corp.supernews.com...
it's the idiot with his query strings again...."yippeee" I hear aaron shout
this time the problem is with a date format query

I have a query string thus

strSQL = "SELECT * FROM users where creation_date >= #" & strthisweekstart & "# AND creation_date <= #" & strthisweekend & "#"

strthisweek start is dateadd("d",-7,date) and strthisweekend is date(). The idea is it shows the records that were added in the last week

so a week ago a response.write of this gave

SELECT * FROM users where creation_date >= #31/12/2004# AND creation_date <= #7/01/2004#

and I thought everything was fine as I got the correct number of records

today I check again and I get the result of zero records, I know this is
wrong..so another response.write and I get

SELECT * FROM users where creation_date >= #07/01/2004# AND creation_date <= #14/01/2004#

which *appears* right only it seems that the first date is in the format
mm/dd/yyy and the second is dd/mm/yyyy

I've checked this by creating a record with the creation date of 14/06/2004, the query then returns correctly, 1 record

so, the pages are interpreting anything that CAN be in the format of
mm/dd/yyyy as such and anything that can't be this format is interpreted as dd/mm/yyyy

where do I tell the pages which date format to use for ALL dates?

bearing in mind I'm in the UK and my windows settings are in UK format
(dd/mm/yyyy), which I thought would automatically set the correct format.

thanks

Jul 19 '05 #2
I have seen this but I don't know how to use it. I would ahave to change 4
fields in a DB containing 22,000 entries too. I think

anyway...if I do a response.write date() I get the correct format....so why
would it be different for other times?

"Vilmar Brazão de Oliveira" <su*****@hitecnet.com.br> wrote in message
news:uB**************@TK2MSFTNGP10.phx.gbl...
hi,
could you use only yyyy/mm/dd ??
if this is possible you have always invert you dates, else
you have treat each case before make a search.
bye

--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
"Alistair" <news@*remove*alistairb.co.uk> escreveu na mensagem
news:10************@corp.supernews.com...
it's the idiot with his query strings again...."yippeee" I hear aaron shout

this time the problem is with a date format query

I have a query string thus

strSQL = "SELECT * FROM users where creation_date >= #" & strthisweekstart &
"# AND creation_date <= #" & strthisweekend & "#"

strthisweek start is dateadd("d",-7,date) and strthisweekend is date(). The
idea is it shows the records that were added in the last week

so a week ago a response.write of this gave

SELECT * FROM users where creation_date >= #31/12/2004# AND

creation_date <=
#7/01/2004#

and I thought everything was fine as I got the correct number of records

today I check again and I get the result of zero records, I know this is
wrong..so another response.write and I get

SELECT * FROM users where creation_date >= #07/01/2004# AND
creation_date <=
#14/01/2004#

which *appears* right only it seems that the first date is in the format
mm/dd/yyy and the second is dd/mm/yyyy

I've checked this by creating a record with the creation date of

14/06/2004,
the query then returns correctly, 1 record

so, the pages are interpreting anything that CAN be in the format of
mm/dd/yyyy as such and anything that can't be this format is interpreted

as
dd/mm/yyyy

where do I tell the pages which date format to use for ALL dates?

bearing in mind I'm in the UK and my windows settings are in UK format
(dd/mm/yyyy), which I thought would automatically set the correct

format.
thanks


Jul 19 '05 #3
HI,
I don't know exactly, but have you tried anything like this:
'07/01/2004' instead #07/01/2004#
??
bye

--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
"Alistair" <news@*remove*alistairb.co.uk> escreveu na mensagem
news:10*************@corp.supernews.com...
I have seen this but I don't know how to use it. I would ahave to change 4
fields in a DB containing 22,000 entries too. I think

anyway...if I do a response.write date() I get the correct format....so why would it be different for other times?

"Vilmar Brazão de Oliveira" <su*****@hitecnet.com.br> wrote in message
news:uB**************@TK2MSFTNGP10.phx.gbl...
hi,
could you use only yyyy/mm/dd ??
if this is possible you have always invert you dates, else
you have treat each case before make a search.
bye

--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
"Alistair" <news@*remove*alistairb.co.uk> escreveu na mensagem
news:10************@corp.supernews.com...
it's the idiot with his query strings again...."yippeee" I hear aaron

shout

this time the problem is with a date format query

I have a query string thus

strSQL = "SELECT * FROM users where creation_date >= #" & strthisweekstart
&
"# AND creation_date <= #" & strthisweekend & "#"

strthisweek start is dateadd("d",-7,date) and strthisweekend is date().
The
idea is it shows the records that were added in the last week

so a week ago a response.write of this gave

SELECT * FROM users where creation_date >= #31/12/2004# AND creation_date
<=
#7/01/2004#

and I thought everything was fine as I got the correct number of

records
today I check again and I get the result of zero records, I know this is wrong..so another response.write and I get

SELECT * FROM users where creation_date >= #07/01/2004# AND

creation_date
<=
#14/01/2004#

which *appears* right only it seems that the first date is in the format mm/dd/yyy and the second is dd/mm/yyyy

I've checked this by creating a record with the creation date of

14/06/2004,
the query then returns correctly, 1 record

so, the pages are interpreting anything that CAN be in the format of
mm/dd/yyyy as such and anything that can't be this format is

interpreted as
dd/mm/yyyy

where do I tell the pages which date format to use for ALL dates?

bearing in mind I'm in the UK and my windows settings are in UK format
(dd/mm/yyyy), which I thought would automatically set the correct

format.
thanks



Jul 19 '05 #4

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

Similar topics

4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
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...
5
by: Macca | last post by:
Hi, I have a table which has a date/time field. I am storing them as follows :- 01/01/2005 11:25 01/01/2005 19:44 02/01/2005 05:04
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...
9
by: Alok yadav | last post by:
i am using a webservice in which a method is serach. i use this method which accept a argument of date type in dd/MM/yyyy formate. i have a textbox which accept the date from the user, when i...
21
by: Darin | last post by:
I have an applicatoin that works 100% perfect when running on a machine setup for English (United States), but when I change it to Spanish (Mexico), the dates start giving me fits. THe reason is...
10
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a...
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.