0

I am trying to write a query that will capture calls completed within 24 hours and calls completed > 24 hours, by call rep, based off of user selected from date and to date range in a web form. I have a column for completion_date in the "yyyy-mm-dd 00:00:00" format, reps, type of call, call requested, and call assigned.

I really need some help!

Adam Tuttle
  • 19,505
  • 17
  • 80
  • 113
Nacole
  • 3
  • 1

1 Answers1

1

If you're trying to figure out the query, something like this should work:

SELECT reps, completion_date
FROM dbo
WHERE completion_date < DATEADD(DAY, DATEDIFF(DAY, 0, @DateSelectedByUser), -1)

This should get you the results within 24 hours, now for the results over 24 hours, you just use > rather than <

Brett
  • 4,051
  • 2
  • 26
  • 39