![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need to write a DTS package which is date oriented and I'm having problems getting something coherent. I'm not a big guy in SQL Server, so please excuse my ignorance. I need to get some sales information based on the previous day...however, if the previous day was Monday, then I need to get the sales data for the Friday. The where clause looks like this (and it's not working....unsurprisingly). /***************************************** where case upper(datename(dd,getdate())) = 'MONDAY' then ididat = getdate(dateadd(day,-3,getdate())) --and ididat < 20060320 else ididat = getdate(dateadd(day,-1,getdate())) --and ididat < 20060320 end /***************************************** Any ideas? Thx for your help |
#3
| |||
| |||
|
|
I need to write a DTS package which is date oriented and I'm having problems getting something coherent. I'm not a big guy in SQL Server, so please excuse my ignorance. I need to get some sales information based on the previous day...however, if the previous day was Monday, then I need to get the sales data for the Friday. The where clause looks like this (and it's not working....unsurprisingly). /***************************************** where case upper(datename(dd,getdate())) = 'MONDAY' then ididat = getdate(dateadd(day,-3,getdate())) --and ididat < 20060320 else ididat = getdate(dateadd(day,-1,getdate())) --and ididat < 20060320 end /***************************************** Any ideas? Thx for your help |
![]() |
| Thread Tools | |
| Display Modes | |
| |