> > That should do it. Just wanted to mention that you could also try
> > GROUP BY DATEPART(m,myDateField)
>
> Make sure you do an ORDER BY Month in your SQL or your groupings will be
> broken up.
One thing I would add to this is that if you're showing more than one year,
or you get to the end of the year, then this becomes incorrect as Dec then
Jan won't work that way
I'd suggest putting something like (for SQL Server)
SELECT
Convert(DateTime,Convert(varchar,DatePart(mm,DateEntered))+'/20/'+Convert(Va
rchar,DatePart(yy,DateEntered)),101) as MonthEntered
The reason I use the 20th is that it will never be confused in European or
American formats
Order by the function as well and it'll come out in the correct order
HTH
Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists