I would like to fetch documents that a property date hour is between midnight and 4 AM. I tried this:
SELECT [This], [Date], FROM Folder_Type_1
WHERE DATEPART(hh,[Date]) >= 0
AND DATEPART(hh,[Date]) <= 4
ORDER BY Date
and
SELECT [This], [Date], FROM Folder_Type_1
WHERE CONVERT(VARCHAR(8),Date,108) between '00:00:00' and '04:00:00'
ORDER BY Date
But none of them is working when I test it in the SQL query builder in the FEM. DATEPART and CONVERT are not recognised. What is the correct way to do it?
I didn't find anything interesting in this SQL syntax reference.
Thank you in advance!
I have used the follwoing before:
This is a snippet from a query executed using the api an not the fem, but in principle this should be the same sql