Date Sorting

G

Guest

hey all,
I'm stumped again here.
I have a report that I'm trying to sort by the date:
2/14/2005
2/9/2005
2/2/2005
10/1/2005

and it's sorting by like
10/1/2005
2/14/2005
2/2/2005
....
I used the Sorting and Grouping in the report to sort acending on that
fldDateIn but it doesn't seem to recognizing it as a true date.
tblMain.fldDateIn is a shortdate format.
 
G

Guest

In the record source of the report, did you format the date field

Format([DateFieldName],"mm/dd/yyyy") As NewFieldName

If you did then the format will convert the date into string
========================

You can add the DateFieldName to the record source, and sort by the real
date field.
 
J

John Spencer

Looks as if the date is a text string.

Try
=DateValue([theDateField])

If this sorts correctly, then look at your query to see if you've used the
format function (not property) to force the date into the short date format.
If so, drop the formating in the query and use the format property on the
control on the report to set the appearance of the date.
 
D

Duane Hookom

Please ignore the "shortdate format" or any other format when sorting. Look
at the actual field data type which has little to do with format/display.

When you open the datasheet view of your report's record source, does the
field "fldDateIn" align to the left or right? If it is left aligned, then I
would expect the report to sort 10/1/2005 before 2/2/2005. If it is right
aligned then it should sort properly.

Check the field data type to see what is actually being stored.
 
G

Guest

Hallo tim,

Pl. send the access97 guide book, which help to me for database.

Regards
Sunil Raut
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top