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.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Weekend dates
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

abacusdotcom
Posting Yak Master

Nigeria
133 Posts

Posted - 04/04/2005 :  09:34:22  Show Profile  Visit abacusdotcom's Homepage  Send abacusdotcom a Yahoo! Message
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

Slovenia
11752 Posts

Posted - 04/04/2005 :  09:37:40  Show Profile  Visit spirit1's Homepage
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

Nigeria
133 Posts

Posted - 04/04/2005 :  10:09:34  Show Profile  Visit abacusdotcom's Homepage  Send abacusdotcom a Yahoo! Message
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

Slovenia
11752 Posts

Posted - 04/04/2005 :  10:19:09  Show Profile  Visit spirit1's Homepage
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

USA
7423 Posts

Posted - 04/04/2005 :  10:26:44  Show Profile  Visit jsmith8858's Homepage
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

Edited by - jsmith8858 on 04/04/2005 10:27:37
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000