You are sorting by the OutageStart but the 'convert' is creating OutageDate.

In order to 'group' by the OutageDate, you should be sorting by the
OutageDate, not the OutageStart.

William

----------------------------------
William Seiter
ColdFusion Web Developer / Consultant
http://william.seiter.com
 
Free Website Trade Publication >> Website Magazine
http://www.websitemagazine.com/referrals/?id=51344&f=text2
Don't forget to answer the survey questions, it's a 10 second task ,
a very small request  for access to this  incredible resource.
 
Have you ever read a book that changed your life?
Go to: http://www.winninginthemargins.com
Use PassKey: GoldenGrove
You'll be glad you did.
 
 
::-----Original Message-----
::From: John Beirne [mailto:[EMAIL PROTECTED]
::Sent: Tuesday, July 22, 2008 1:35 PM
::To: CF-Newbie
::Subject: Grouping not working with dates
::
::
::I'm working on a report in CFML that should group records by date,
::something like:
::Tuesday, July 1, 2008
::When: July 1 from 8:00 AM until 8:12 AM
::Location: Chicago
::Business Unit: WLS
::Priority: 1, Ticket23
::Brief Description: Hanes tidy whiteys
::Cause: 'Cause I said so
::Impact: Wrench
::Resolution: We don't wanna change the world
::
::When: July 1 from 9:00 AM until 9:12 AM
::Location: New Zealand
::Business Unit: Foo
::Priority: 1, Ticket34
::Brief Description: Glibby glab
::Cause: Because we like you!
::Impact: Ouch
::Resolution: Nafr nafr
::
::Wednesday, July 2, 2008
::When: July 2 from 8:00 AM until 8:12 AM
::Location: Berwyn
::Business Unit: CTU
::Priority: 5, Ticket24
::Brief Description: lsdjfkjds
::Cause: XXXXXXXXX
::Impact: XXXXXXXXX
::Resolution: XXXXXXXXXXXXXXX
::
::What's happening is the dddd, mm/dd/yyyy are appearing for every record.
::I'm attaching the pertinent section of code. Thanks for any help!
::
::
::Attach Code
::
::<cfquery name ="qryWIRDate" datasource="#Session.PMDBDataSource#">
::SELECT
::      'Date' as ReportGroup
::    , convert(datetime, convert(varchar, SCTicket.OutageStart, 104),104)
::as OutageDate
::      , SCTicket.OutageStart
::      , SCTicket.OutageEnd
::      , '1' as SortField
::      , Pri.Abbrev
::      , SCTicket.SCTicket
::      , SCTicket.IssueTitle
::      , SCTicket.RootCause
::      , SCTicket.Impact
::      , SCTicket.Resolution
::      , SCTicket.ResultOfChange
::      , CASE WHEN SCTicket.ResultOfChange = '1' THEN ', Result Of Change'
::END as ROCIndicator
::FROM
::      tblSCTicket SCTicket
::              INNER JOIN tblPriorities Pri
::                      ON SCTicket.PriorityID = Pri.PriorityID
::WHERE  (SCTicket.SCDateEntered between '#Start#' and '#End#')
::AND SCTicket.SCTicket = '#aryDistTckts[i]#'
::  ORDER BY OutageStart,
::        SCTicket
::</cfquery>
::
::<cfoutput query="qryWIRDate" group="OutageDate">
::<P></P>
::#DateFormat(OutageDate, "dddd, mm-dd-yy")#
::
::<table class="ticket">
::<tr>
::      <th>When:</th>
::      <td>#DateFormat(OutageStart, "mm/dd/yy")# from
::#TimeFormat(OutageStart, "h:mm tt")# until #TimeFormat(OutageEnd, "h:mm
::tt")#</td>
::</tr>
::<tr>
::      <th>Priority:</th>
::      <td>#Abbrev#, #SCTicket# #ROCIndicator#</td>
::</tr>
::<tr>
::      <th>Brief Description:</th>
::      <td>#IssueTitle#</td>
::</tr>
::<tr>
::      <th>Cause:</th>
::      <td>#RootCause#</td>
::</tr>
::<tr>
::      <th>Resolution:</th>
::      <td>#Resolution#</td>
::</tr>
::</table>
::
::
::</cfoutput>
::
::

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3856
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to