could you please send that query (or at least part of it)?
Here is the part of the SQL from Report Writer that I am working with -
( DateTime BETWEEN 40848 AND 40876 )
I was hoping for a website that I could go to for converation of a date (i.e. 12/1/2011) to the SQL datetime string (i.e. 40848).
If you want to know meaning of these values you can use following queries:
SELECT CAST(40848 AS DATETIME)
SELECT CAST(40876 AS DATETIME)
I really don't know why somebody wrote these queries this way. I would say you can switch these constants with human-readable strings, that means something like:
WHERE (DateTime BETWEEN '2012-01-21' AND '2012-02-21')
There is only one danger - based on your local setting you can have swapped months and days in datetime. Maybe this is reason why somebody wrote it as constants. Probably safest way is to write it in ISO 8601 format - for example '20010225' - format 'YYYYMMDD.'
I am using advance SQL and i copy paste code from existing report for last month and using date date and floating digits. is SQL automatically figure out my last month date and time? how do i write syntax to generate last month report?