/build/static/layout/Breadcrumb_cap_w.png

Ticket Report for a specific month

Hi I am trying to create a report of all tickets that were sent in a a specific month. I would like to have this report so we can edit the month and year and grab a report from what ever time period we need. I am having trouble creating the filter that does that. My reports come back empty. I cant tell what im doing wrong after reading some posts about the same issue. Below is the SLQ code of my report. The example that is there I am trying to get tickets created in January 2019.  I made this using the wizard but it is still blank, I tried changing > to >= and < to <= but still nothing. Am I missing something obvious? Any help is very appreciated.


SELECT HD_TICKET.TITLE, CTEXT.NAME AS CATEGORY_TEXT, HD_TICKET.RESOLUTION, S.FULL_NAME AS SUBMITTER_NAME, O.FULL_NAME AS OWNER_NAME, IF(HD_TICKET.HD_USE_PROCESS_STATUS and HD_TICKET.IS_PARENT, HD_SERVICE_STATUS.NAME, HD_STATUS.NAME) AS STATUS_NAME  FROM HD_TICKET  LEFT JOIN HD_CATEGORY CTEXT ON (CTEXT.ID = HD_TICKET.HD_CATEGORY_ID)

LEFT JOIN USER S ON (S.ID = HD_TICKET.SUBMITTER_ID) LEFT JOIN USER O ON (O.ID = HD_TICKET.OWNER_ID) LEFT JOIN HD_SERVICE_STATUS ON HD_TICKET.HD_USE_PROCESS_STATUS and HD_TICKET.HD_SERVICE_STATUS_ID and HD_SERVICE_STATUS.ID = HD_TICKET.HD_SERVICE_STATUS_ID JOIN HD_STATUS ON (HD_STATUS.ID = HD_TICKET.HD_STATUS_ID)

WHERE (HD_TICKET.HD_QUEUE_ID = 1) AND ((HD_TICKET.CREATED > '2019-01-01 00:00:00') AND (HD_TICKET.CREATED < '2019-01-31 23:59:59'))  ORDER BY TITLE




0 Comments   [ + ] Show comments

Answers (1)

Posted by: chucksteel 4 years ago
Red Belt
0

I like using the between operator:

DATE(HD_TICKET.CREATED) BETWEEN "2020-01-01" AND "2020-01-31"  

You could also do something like:

MONTH(HD_TICKET.CREATED) = 1 and YEAR(HD_TICKET.CREATED) = 2020



Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ