Help with a Sort

  • Thread starter Thread starter Zane
  • Start date Start date
Z

Zane

I am trying to sort my data with two dates. I have an
original date, and a modified date. The modified date is
only populated when the original date has changed. The
way I want to sort them is by month. I would like all
modified and original dates falling in a certain month to
be grouped together. Right now the query sorts by
modified date then original, so rather than having twelve
groups, one for each month, I have 24, one set of twelve
for each date. The SQL looks like:

ORDER BY [MAIN TABLE].[Modified Disclosure Date], [MAIN
TABLE].[Disclosure Date];

I would also like to group within the months for two
other options. I still have a little trouble with SQL
statements so if you wouldn't mind giving me an example
(i.e. Sort by [main table].[group 1] then [group 2],
etc.) it would be greatly appreciated. I hope this makes
sense.

Thanks
Zane
 
Try this ORDER BY
ORDER BY Month(IIf(IsNull([MAIN TABLE].[Modified Disclosure
Date]),[MAIN TABLE].[Modified Disclosure Date],[MAIN
TABLE].[Modified Disclosure Date]))

Hope This Helps
Gerald Stanley MCSD
 
Back
Top