|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
between 10am and 10am...
Below I have two SQL queries, one that says "how many in last full week" and the other that says "How many between 10am on this day and 10am on this day"
What I'd like is one query that says "How many between last Friday at 10am and the previous Friday at 10am?" Any thoughts on how I would write this? Thanks, Dan SELECT dbo.table_case.id_number FROM dbo.table_case, dbo.table_user dbo_table_owner_user WHERE ( dbo_table_owner_user.objid=dbo.table_case.case_owner2user ) AND (( {fn week(( CONVERT(CHAR, dbo.table_case.creation_time, 101) ))} = {fn week(convert (SMALLDATETIME, {fn CURDATE()}))}-1 AND DATEDIFF(dd,( CONVERT(CHAR, dbo.table_case.creation_time, 101) ),convert (SMALLDATETIME, {fn CURDATE()})) < 14 ) AND dbo_table_owner_user.login_name = 'kmitchell' ) ++++++++++++++++++++++++++++++++++++++ SELECT dbo.table_case.id_number FROM dbo.table_case, dbo.table_user dbo_table_owner_user WHERE ( dbo_table_owner_user.objid=dbo.table_case.case_owner2user ) AND ( dbo_table_owner_user.login_name = 'kmitchell' AND dbo.table_case.creation_time BETWEEN '01/30/2004 10:0:15' AND '02/06/2004 10:0:15' ) |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > between 10am and 10am... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|