I have this query
WITH NumberedRows AS
(
SELECT Serial,
DateReceived,
DeviceLevel,
ROW_NUMBER() OVER (ORDER BY DateReceived) AS RowNumber
FROM TBLReadings
)
SELECT *
FROM NumberedRows
WHERE RowNumber % 5 = 1 and Serial like '+447584996153'
I need to search between date – the last 7 days. I know the search..
WHERE DateReceived BETWEEN 'blahblah' and 'blahblah'
But what is the function? I have tried different formats to call the date specifically.
The current data retrieves the date in dd/mm/yyyy 00:00:00 format.
I do not know how to use the functions for date in the search correctly (I’m guessing this is why I cannot get any data when I search between dates as I just shows col name and no data)
Try Using DATEADD function to get data of last seven days:
or