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.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Weekend dates

Author  Topic 

abacusdotcom
Posting Yak Master

133 Posts

Posted - 2005-04-04 : 09:34:22
Hi all,
I will always thank you guys first, for your time! (--Spirit1_te Kudos).
I have a situation here, am doing date calculations, but the problem arises when the second date is across weekends. i dont always have accurate answers. Please, do help to tackle this.thanks

I sign for fame not for shame but all the same, I sign my name.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-04-04 : 09:37:40
so what do you want to do when there's a weekend? skip it?

Go with the flow & have fun! Else fight the flow
Go to Top of Page

abacusdotcom
Posting Yak Master

133 Posts

Posted - 2005-04-04 : 10:09:34
Hi All
i want to skip weekend days

I sign for fame not for shame but all the same, I sign my name.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-04-04 : 10:19:09
something like this maybe?

select case datename(dw, dateColum) = 'Saturday' then
dateadd(d, -1, dateColum)
case datename(dw, dateColum) = 'Sunday' then
dateadd(d, -2, dateColum)
else dateColum
end


Go with the flow & have fun! Else fight the flow
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-04-04 : 10:26:44
Take a look at the information you have provided:

>> have a situation here, am doing date calculations
what kind of calculations? what are the inputs, what is the logic, what are you returning?

>>but the problem arises when the second date is across weekends.
The second date? What do you mean by second date? What is the problem?

>>i dont always have accurate answers.
Can you give examples? what is the question? what should the answer be?

>>Please, do help to tackle this
Tackle what? Do what, specifically?

Sorry to come off as picky, but do you see how you've basically provided more questions than information?

- Jeff
Go to Top of Page
   

- Advertisement -