|
 |
access_asp thread: Please Help! -- How to search between two dates if date field is text
Message #1 by "Omar Esquivel" <omare@u...> on Thu, 1 Aug 2002 19:59:57
|
|
Hi,
Please I need some help.
I have my date fields in text type, that way I can write dates no matter
what regional settings the server has. My problem now arises because I
have to make a SQL query that allows me to search between two date ranges
and display the records between those dates.
Can I do something like that with dates in text format?
Please any help or idea would be greatly appreciated.
Thanx
Omare.
Message #2 by Oriol Carol Gres <oriol.carol@u...> on Thu, 01 Aug 2002 23:05:10 +0200
|
|
Hi Omar,
I had some trouble with dates and I found a quite good solution. Is not a matter
of regional settings only. When you try to insert or update a record, the sql
statement uses m/d/Y format. So, if you are working with an access database you
will have lots of problems. I supose thats why you decided to insert dates as
text.
My solution is to format the dates before they are sent. This way you will be
sure that all dates are in the same format in the database, and no error is then
possible when handling them.
You'll find more information here:
http://www.adopenstatic.com/faq/DateswithAccess.asp
http://www.4guysfromrolla.com/webtech/022701-1.shtml
Greetings,
Oriol
En/Na Omar Esquivel ha escrit:
> Hi,
>
> Please I need some help.
>
> I have my date fields in text type, that way I can write dates no matter
> what regional settings the server has. My problem now arises because I
> have to make a SQL query that allows me to search between two date ranges
> and display the records between those dates.
>
> Can I do something like that with dates in text format?
>
> Please any help or idea would be greatly appreciated.
>
> Thanx
>
> Omare.
>
Message #3 by "Ken Schaefer" <ken@a...> on Fri, 2 Aug 2002 10:56:21 +1000
|
|
If you want to search for dates, make the fields date/time fields.
The type of shortcut you are using (using a text field) will always come
back to bite you in the backside eventually. There is a reason why there are
text fields, and date/time fields...
To get around the problem of differing date/time regional settings, using
ISO format to insert/query the database (yyyy/mm/dd hh:mm:ss):
www.adopenstatic.com/faq/dateswithaccess.asp
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Omar Esquivel" <omare@u...>
Subject: [access_asp] Please Help! -- How to search between two dates if
date field is text
: Please I need some help.
:
: I have my date fields in text type, that way I can write dates no matter
: what regional settings the server has. My problem now arises because I
: have to make a SQL query that allows me to search between two date ranges
: and display the records between those dates.
:
: Can I do something like that with dates in text format?
|
|
 |