Order by date not by alphabatical order but by usual jan - Feb etc required

  • No idea why you haven't tried the options provided to you but using your original post in this thread (and Jeff's suggestion), try this:

    select right(convert(varchar, CCD.startDateTime , 106), 8) as startmonth,

    sum(case when CCD.contactDisposition = 1 then 1 else 0 end) as TotalCalls1,

    sum(case when CCD.contactDisposition = 2 then 1 else 0 end) as TotalCalls2

    from ContactCallDetail CCD

    inner join ContactQueueDetail CQD on CCD.sessionID = CQD.sessionID

    and CCD.sessionSeqNum = CQD.sessionSeqNum

    and CCD.profileID = CQD.profileID

    and CCD.nodeID = CQD.nodeID

    where

    CCD.applicationName = 'FLVS'

    and CCD.contactType = 1

    and contactDisposition in (1, 2)

    and CCD.startDateTime >= '2011-01-01 00:00:00.000'

    and CCD.startDateTime < '2012-01-01 00:00:00.000'

    group by right(convert(varchar, startDateTime , 106), 8), datediff(month, 0, startDateTime)

    order by datediff(month, 0, startDateTime)

  • This works fine now. Thank you very much for the help.

    I greatly appreciate this. this will solve my problem.

Viewing 2 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply