J
Joel Wiseheart
I have a crosstab query that pulls date data from an HP
server, where dates are stored as integers (From our 30-
year old ManMan MRP system). To make it useable in a
modern date format, I have to do the following:
DueDate:CDate([DateField]+26236)
(The "+ 26236" is to accomodate the fact that 0 =
1/1/1900 in Microsoft prograqms, and 10/30/1971 in HP. Go
figure).
The default format of the CDate function is "mm/dd/yyyy".
I would like to change the date format to "m/d/yy". By
shortening the year by two digits, and also shortening
the day and month, it saves about 50 pages on the printed
version once the report is complete, due to space
considerations.
....Now for the problem...
When I format the date as such:
DueDate:Format(CDate([DateField]+26236),"m/d/yy")
the proper formatting is applied, but the sorting now
treats the date like a text string. It sort by month
instead of year, like below:
1/4/03
1/4/04
1/4/05
1/5/03
1/5/04
1/5/05
etc.
I need it to sort like:
1/4/03
1/5/03
1/4/04
1/5/04
1/4/05
1/5/05
It's starting from the leftmost character, and working to
the right for sorting, instead of sorting in
chronological order like date fields do.
Is there a way to get the shorter format, and still
have it sort chrololoically?
Thanks!
server, where dates are stored as integers (From our 30-
year old ManMan MRP system). To make it useable in a
modern date format, I have to do the following:
DueDate:CDate([DateField]+26236)
(The "+ 26236" is to accomodate the fact that 0 =
1/1/1900 in Microsoft prograqms, and 10/30/1971 in HP. Go
figure).
The default format of the CDate function is "mm/dd/yyyy".
I would like to change the date format to "m/d/yy". By
shortening the year by two digits, and also shortening
the day and month, it saves about 50 pages on the printed
version once the report is complete, due to space
considerations.
....Now for the problem...
When I format the date as such:
DueDate:Format(CDate([DateField]+26236),"m/d/yy")
the proper formatting is applied, but the sorting now
treats the date like a text string. It sort by month
instead of year, like below:
1/4/03
1/4/04
1/4/05
1/5/03
1/5/04
1/5/05
etc.
I need it to sort like:
1/4/03
1/5/03
1/4/04
1/5/04
1/4/05
1/5/05
It's starting from the leftmost character, and working to
the right for sorting, instead of sorting in
chronological order like date fields do.
Is there a way to get the shorter format, and still
have it sort chrololoically?
Thanks!