I got an Oracle database statement which displays the data of the last 7 days in my script
The statement is :
Code:
select * from TABLE_NAME
WHERE DATETIME BETWEEN to_char((sysdate-7,MM), 'DDMMYYYY%') AND
to_char((sysdate,MM), 'DDMMYYYY%')
ORDER BY DATETIME ASC;
But, this output gives me the results of the previous months data aslo on that particular week
Quote:
DATETIME format is DDMMYYYY HH:MI
How to get only this months data and not the previous months data
make DATETIME a date instead: