No worries, my apologies here is more data (hopefully).
So the table is like this with the fields I will need to pull this data for the query:
callrefdate_timeevb_recipient_email
49898711/06/2015 08:22:04NULL
49974812/06/2015 13:24:33NULL
50471619/06/2015 15:21:11NULL
50730325/06/2015 10:29:47NULL
49371001/06/2015 11:40:46candidate_support@email.co.uk
50165316/06/2015 19:18:07candidate_support@email.co.uk
50189317/06/2015 10:08:52candidate_support@email.co.uk
49547704/06/2015 08:26:10help@email.co.uk
50201617/06/2015 11:52:50help@email.co.uk
49717108/06/2015 09:23:34help@email.net
In the last instance of asking, they wanted a total count of all callrefs per hour that were closed. I did this with the query that I included below.
I have tried the following query to get the data for the half hourly intervals but received the error Implicit conversion from data type datetime to float is not allowed. Use the CONVERT function to run this query.
select Count(*) as 'Total', DateAdd(Minute, 30 * (DateDiff(Minute, 0, closedate) / 30), 0) as 'Time Interval'
from vw_opencall
where evb_recipient_email like'help@email%'
and day (close_date) = '03'
and month(close_date) = '08'
and year (close_date) = '2014'
group by DateAdd(Minute, 30 * (DateDiff(Minute, 0, closedate) / 30), 0)
order by ABS (DateAdd(Minute, 30 * (DateDiff(Minute, 0, closedate) / 30), 0)) ASC
The above was a test for just grabbing out the time for a particular day on the basis they were running one day at a time.
Looking at how they would like to run the query themselves and that this now will be on multiple days I would expect the output data to look like this:
Date Time Total
06/07/201509:305
06/07/201510:008
06/07/201510:303
06/07/201511:002
Any help is appreciated, I admit I haven't tried to do the multiple dates but I have assumed this would be a convert statement to get out just this part of the datetime value. It's the 30 minute interval piece that I am stuck on.
Thank you again!