2
Good, how do I make to obtain the last day of the previous month dynamically (associated with the current date);
I have a spine which is associated with the date on Milliseconds 'Wo.CREATEDTIME' - Example of some dates in this format :
1527807600000
1143564400000
SELECT Count(wo.WORKORDERID) AS "Request ID",
CASE
WHEN cd.CATEGORYNAME = '01 RMS Application' THEN 'Aplicação'
ELSE cd.CATEGORYNAME
END AS Category
FROM WorkOrder wo
LEFT JOIN WorkOrderStates wos
ON wo.WORKORDERID=wos.WORKORDERID
LEFT JOIN CategoryDefinition cd
ON wos.CATEGORYID=cd.CATEGORYID
WHERE (((wo.CREATEDTIME >= 1527807600000)
AND ((wo.CREATEDTIME != 0)
AND (wo.CREATEDTIME IS NOT NULL)))
**AND ((wo.CREATEDTIME <= 1530399599000)**
AND (((wo.CREATEDTIME != 0)
AND (wo.CREATEDTIME IS NOT NULL))
AND (wo.CREATEDTIME != -1))))
AND wo.ISPARENT='1'
AND wo.IS_CATALOG_TEMPLATE='0'
Group By 2
Order By 1 DESC LIMIT 5
In the Part of Where I suppose that’s where we’ll need to make the condition: How do I say Wo.CREATEDTIME <= "Last day of the month Previous" help would be very welcome.
Possible duplicate of SQL Coverter/Ober last day of the previous month
– Tiedt Tech