Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Makaio780
Starting Member
24 Posts |
Posted - 2012-06-27 : 13:17:46
|
select Incident_Number,Reported_dateFrom vars76_Hpd_help_deskwhere reported_date > @startdate and reported_date < @startdateHow can i extract tickets that are between 7am and 5pm when parameters entered are 5/1/2012 and 6/1/2012.Ron Cheung |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-06-27 : 13:24:36
|
addand DATEPART(Hour,ReportDate) BETWEEN 7 and 17JimEveryday I learn something that somebody else already knew |
|
|
Makaio780
Starting Member
24 Posts |
Posted - 2012-06-27 : 13:43:46
|
Thanks!!!!Ron Cheung |
|
|
Makaio780
Starting Member
24 Posts |
Posted - 2012-06-27 : 14:16:44
|
select Incident_Number,Reported_dateFrom vars76_Hpd_help_deskwhere reported_date > '6/1/2012'AND reported_date < '6/14/2012'AND (((DATEPART(Hour,Reported_Date) BETWEEN 5 and 22) and (DATEPART(Weekday,Reported_date) Between 2 and 6))Order by reported_date ascHow would i add time frame of Saturday and Sunday from 7am to 5pm?Ron Cheung |
|
|
|
|
|