Sort Dates

  • Thread starter Thread starter Aurora
  • Start date Start date
A

Aurora

I am using Access 2000.

How do I sort by the month of a Birthdate (date field)?

Aurora
 
Assuming you want to start with January 1, type this into the Field row of
your query to sort by:
DateSerial(Year(Date()), Month([Birthdate], Day([Birthdate]))
 
This is the formula I put in the field. But I get an
error message that says I have too many arguments. Can
you see what I am doing wrong?

DateSerial (Year(Date()), Month([Bdate1], day([Bdate1]))

Aurora

-----Original Message-----
Assuming you want to start with January 1, type this into the Field row of
your query to sort by:
DateSerial(Year(Date()), Month([Birthdate], Day ([Birthdate]))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I am using Access 2000.

How do I sort by the month of a Birthdate (date field)?

Aurora


.
 
The is a missing bracket for the Month() part:
DateSerial (Year(Date()), Month([Bdate1]), Day([Bdate1]))
 
Allen:
I don't know what I am doing wrong. I retyped the formula
and it works in the query, but does not work in the report
Birthday list by Month. I used both the Bdate1 field and
the formula that I called BD1Month field. Neither one
will work in the report.

Any ideas of what is wrong? PS - thank you for trying to
help me. I really appreciate it.

Aurora




-----Original Message-----
The is a missing bracket for the Month() part:
DateSerial (Year(Date()), Month([Bdate1]), Day ([Bdate1]))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

This is the formula I put in the field. But I get an
error message that says I have too many arguments. Can
you see what I am doing wrong?

DateSerial (Year(Date()), Month([Bdate1], day([Bdate1]))

Aurora


.
 
If the query itself sorts correctly, but the report does not, open your
report in design view and make sure you have nominated this field (the
calculated field) in the Sorting And Grouping dialog (View menu). If you
don't do that, the sorting in the report is undefined, i.e. it probably
won't sort the same as the query.

If the itself query does not sort correctly when you run it, it is possible
that it has misunderstood the data type. Does the field display left-aligned
(like text) or right-aligned (like a date)? If left, wrap CDate() around the
expression:
CDate(DateSerial (Year(Date()), Month([Bdate1]), Day([Bdate1])))
I think that would be unusual, unless you have lots of Nulls in your Bdate1
field (which would probably be shoing #Error in the query output).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Aurora said:
Allen:
I don't know what I am doing wrong. I retyped the formula
and it works in the query, but does not work in the report
Birthday list by Month. I used both the Bdate1 field and
the formula that I called BD1Month field. Neither one
will work in the report.

Any ideas of what is wrong? PS - thank you for trying to
help me. I really appreciate it.

Aurora




-----Original Message-----
The is a missing bracket for the Month() part:
DateSerial (Year(Date()), Month([Bdate1]), Day ([Bdate1]))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

This is the formula I put in the field. But I get an
error message that says I have too many arguments. Can
you see what I am doing wrong?

DateSerial (Year(Date()), Month([Bdate1], day([Bdate1]))

Aurora


.
 
Back
Top