Strip time from Date/Time field in OBIEE
582683Jun 26 2008 — edited Jul 1 2008I'm doing calculations that determine the number of incidents from one year to the next...it's critical to compare the exact same year to date ie (1/1/2008 12AM to 6/25/08 11:59 PM to 1/1/2007 12AM to 6/25/07 11:59 PM ........if I do the code below for the previous year, it doesn't return the correct period for 2007.
sum(CASE WHEN dtcrash between '01/01/2007 00:00:00' and timestampadd (sql_tsi_year, -1, timestampadd (sql_tsi_day, -1, current_timestamp)) THEN 1 ELSE 0 END)
The above gives me 1/1/2007 12 AM to 6/25/07 11:19AM - I need it to be for the entire day on 6/25/07....How can I accomplish?