sql - DB2 to Oracle Conversion For Basic Date Time Column Between Clause -


what doing selecting columns table specific date time column between last sunday , coming saturday, 7 days total (no matter day of week running query on)

i have converting below statement oracle since found out not work on oracle.

select * table date_time_column between current date - ((dayofweek(current date))-1) days , current date + (7-(dayofweek(current date))) days 

after poking around bit more able find worked specific problem no administrator restrictions whatever reason:

select * table date_time_column between     timestampadd(sql_tsi_day, dayofweek(current_date)*(-1) + 1, current_date) ,     timestampadd(sql_tsi_day, 7 - dayofweek(current_date), current_date) 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -