Sorting issue

  • Thread starter Thread starter Victor
  • Start date Start date
V

Victor

I have the following field in my table :
Format([Date],"mmm yy"). it is supposed to show a date
field in a monthly format . like Jun 04. However,I cant
figure out how to get the results to be sorted by monht -
jan -> dec. The results are sorted aalphabetically, thus
putting July 04 beofre June.... any fix for this? thanks
 
Hi.

I get an error message when i implement your suggestion
below- "You tried to execute a query that does not
inlcude the specified expression [Date] as part of an
aggregate function".

The sql line for the query looks like ... SELECT Format
([Date],"mmm yy") AS [Month]

So I used [Month] in place of [Date] and it still didnt
work...
V


-----Original Message-----
SELECT Format([Date], "mmm yy") ...
FROM ...
ORDER BY [Date]

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

I have the following field in my table :
Format([Date],"mmm yy"). it is supposed to show a date
field in a monthly format . like Jun 04. However,I cant
figure out how to get the results to be sorted by monht -
jan -> dec. The results are sorted aalphabetically, thus
putting July 04 beofre June.... any fix for this?
thanks

.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This means you're GROUPing the results of the SELECTion, which means you
have to include the column [Date] in the SELECT and GROUP BY clauses.
If you want the months sorted in chronological order you will have to
get the month number from the [Date] column. This is usually done w/
the DatePart() or Month() functions:

theMonth: DatePart("m", [Date])

theMonth: Month([Date])

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQRF9S4echKqOuFEgEQKW9wCfVqIusb64wFbfL7OH1Xj4P0HpZb0AoJqH
UsFYPdzxG5b1rfUh2x2kU4fp
=aOgj
-----END PGP SIGNATURE-----

Hi.

I get an error message when i implement your suggestion
below- "You tried to execute a query that does not
inlcude the specified expression [Date] as part of an
aggregate function".

The sql line for the query looks like ... SELECT Format
([Date],"mmm yy") AS [Month]

So I used [Month] in place of [Date] and it still didnt
work...
V



-----Original Message-----
SELECT Format([Date], "mmm yy") ...
ORDER BY [Date]

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)


Victor wrote:

I have the following field in my table :
Format([Date],"mmm yy"). it is supposed to show a
date
field in a monthly format . like Jun 04. However,I
cant
figure out how to get the results to be sorted by

monht -
thus

thanks

.
 
Back
Top