Hi all,
I have written a query that will allow me to extract data from a table that will grab all records from last month -
WHERE EXTRACT(MONTH FROM `DATE_TIME`) = (EXTRACT(MONTH FROM CURDATE()) )
This is all well and good, except for where I wish to run in January, because obviously my month-1 would equal 0.
Is there anyway around this?
thanks.
I have written a query that will allow me to extract data from a table that will grab all records from last month -
WHERE EXTRACT(MONTH FROM `DATE_TIME`) = (EXTRACT(MONTH FROM CURDATE()) )
This is all well and good, except for where I wish to run in January, because obviously my month-1 would equal 0.
Is there anyway around this?
thanks.