Hi,
I am using a MSSQL database, and I am trying to select records from a db based on a 15 minute interval. The Date is recorded as a millisecond epoch time (stored as a numeric) which I round down to the nearest 15 minute window within the hour:
SELECT ID, floor(rawdateandtime/900000)*900000 as flooredDate, rawdateandtime, Value
FROM TBL1
WHERE ID = 'ID1'
AND RawDateAndTime BETWEEN 1243810800000 AND 1244415000000
My problem is that sometimes records may not exist and i want to return an empty/null row for that missing record somehow, but i am very new to SQL and i have no idea where to start on the query.
Can anyone offer me any pointers?
I am using a MSSQL database, and I am trying to select records from a db based on a 15 minute interval. The Date is recorded as a millisecond epoch time (stored as a numeric) which I round down to the nearest 15 minute window within the hour:
SELECT ID, floor(rawdateandtime/900000)*900000 as flooredDate, rawdateandtime, Value
FROM TBL1
WHERE ID = 'ID1'
AND RawDateAndTime BETWEEN 1243810800000 AND 1244415000000
My problem is that sometimes records may not exist and i want to return an empty/null row for that missing record somehow, but i am very new to SQL and i have no idea where to start on the query.
Can anyone offer me any pointers?