Jeff Parker
|
| Posted: 02/08/2002, 2:15 AM |
|
I am using European format dates, i.e. dd/mm/yy and am having a problem with date searches. Let us assume I have a record with a date 27/01/2002 (27 Jan 2002). If I search for dates > 13/01/2002 (13 Jan 2002) the search is successful and returns the record. However, if I search for something like > 02/01/2002 (2 Jan 2002), the search fails to find the record. Is this because the search date is now being read in US format and is therefore being interpreted as 1 Feb 2002? If so, is there any solution?
|
|
|
 |
CodeCharge Support
|
| Posted: 02/08/2002, 5:08 AM |
|
Jeff,
please refer to GotoCode article to find how to convert dates in different formats: http://www.gotocode.com/art.asp?art_id=132&
Call the function that converts dates in Open event of search form in order to pass to db converted date, e.g.:
sWhere = replsce(sWhere, GetParam("date_field"), my_date_format("date_field"))
I suppose the function my_date_format() described in article should be modified a little. Test the original one but if you're sure that the date is entered in dd/mm/yyyy format you may use instead initial function code that is:
d = DatePart("d", old_date)
m = DatePart("m", old_date)
y = DatePart("yyyy", old_date)
the following one:
d = mid(old_date, 1, 2)
m = mid(old_date, 4, 2)
y = mid(old_date, 7)
|
|
|
 |
dava133
|
| Posted: 03/10/2002, 3:50 PM |
|
Im having the same problem and understand the solution given here but how do u incorperate the #'s for Access dates?? sorry if this is a simple question but i have messed for a bit with this too no avail! cheers
|
|
|
 |
dava133
|
| Posted: 03/12/2002, 1:37 AM |
|
never mind my problem ive solved it now
|
|
|
 |
Geert Larsen
|
| Posted: 03/12/2002, 3:08 AM |
|
I'm glad that you succeeded, but
since you took your time to tell us
could you be so kind to tell us (ie. me) how you did ??
TIA
Geert
|
|
|
 |
|