5 pts.
 I want to exclude a timeframe (Friday 11 PM to Sunday 11 PM data) from my query
I have a query to calculate TAT.I want to exclude records between Friday 11 PM to Sunday 11 PM from the query

Software/Hardware used:
ASKED: July 20, 2009  9:45 AM
UPDATED: July 30, 2009  3:33 PM

Answer Wiki:
a generic answer - you say query so I assume the SQL language is involved - almost all flavors of SQL have a function to determine day of week and they all have a date/time datatype - so you want to use these capabilities to exclude certain rows ... WHERE ... AND NOT ( < -- this will exclude rows that meet the following conditions ( DAY_OF_WEEK(date_column) = 'FRIDAY' < -- this varies depending on DB2 or Oracle or MySQL or ... AND time_column > 23:00:00 ) OR (DAY_OF_WEEK(date_column) = 'SATURDAY') OR (DAY_OF_WEEK(date_column = 'SUNDAY' AND time_column < 23:00:00) caveat - be very careful if you specify 11PM - do you really want 10:59:59 PM or 11:00:01 PM ? Steve
Last Wiki Answer Submitted:  July 30, 2009  3:33 pm  by  Meandyou   5,205 pts.
All Answer Wiki Contributors:  Meandyou   5,205 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Do you want to exclude that timeframe for all weeks ?
What database are you using ?

 63,580 pts.