Jump to content

Current calls logged this month


yelyah.nodrog

Recommended Posts

Morning all,

I am trying to create a widget to tell me the current calls logged this month so far. so from the 1st nov to current date, I don't want to have to change the query every month to keep up and want it to roll each month.

So I have written this (I'm quite new to T-sql so it wont be right!):

(h_requesttype = 'Service Request' OR h_requesttype = 'Incident')
AND
DATE(h_datelogged) BETWEEN dateadd(DAY,-(DATEPART(DAY,GETDATE())-1),GETDATE()) AND GETDATE())

however its not working, is this anywhere near right? Could someone point me in the correct direction with this query, also is there a easier way to do it?

Thanks

Hayley

Capture123.PNG.75220047091337c10f4f1d3702672013.PNG

 

 

Link to comment
Share on other sites

Hey Victor, I have given this a go but it is not reporting correctly?

Today is the start of a new week and we have logged 16 calls so far this morning, however its not showing any as being logged? - I have refreshed it to make sure and still nothing.

Capture.PNG.38eb02563ef20a350aeecf075789de40.PNG

This is the code we are currently using:

Capture1.PNG.c8b2155d52ccf12c3c3736ad451d9968.PNG

These are the logged calls so far today

Capture3.thumb.PNG.5ab747704d47771e2ee338ffef50636c.PNG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...