<< April 19, 2010 | Home | April 21, 2010 >>

DWH n days ago up to now

copy paste thingy

To query data for a datawarehouse report starting at n-days ago at midnight up to newest available data, I can use the following SQL:

 timestamp(char(date(current timestamp - 2 days)) concat '-00.00.00.000000')