SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sum datediff with minus weekend
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

calvinkwoo3000
Yak Posting Veteran

Singapore
98 Posts

Posted - 03/22/2012 :  00:04:09  Show Profile  Reply with Quote
Dear expertise and admin,

how do i sum a datediff with minus out the weekend(saturday and sunday).
thank you.

khtan
In (Som, Ni, Yak)

Singapore
17638 Posts

Posted - 03/22/2012 :  00:06:24  Show Profile  Reply with Quote
Best is you have a calendar table. Then you can also exclude public holiday etc


KH
Time is always against us

Go to Top of Page

calvinkwoo3000
Yak Posting Veteran

Singapore
98 Posts

Posted - 03/22/2012 :  00:09:11  Show Profile  Reply with Quote
quote:
Originally posted by khtan

Best is you have a calendar table. Then you can also exclude public holiday etc


KH
Time is always against us





khtan, yes i have a holiday table,
how do i able to minus it together?
our holiday is declare from and to date...
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17638 Posts

Posted - 03/22/2012 :  00:15:49  Show Profile  Reply with Quote
if you don't have a calendar table, it is worth while to create one. It make things much easier.

If you don't have one, you can consider MVJ's F_TABLE_DATE


KH
Time is always against us

Go to Top of Page

calvinkwoo3000
Yak Posting Veteran

Singapore
98 Posts

Posted - 04/02/2012 :  05:33:40  Show Profile  Reply with Quote
quote:
Originally posted by khtan

if you don't have a calendar table, it is worth while to create one. It make things much easier.

If you don't have one, you can consider MVJ's F_TABLE_DATE


KH
Time is always against us





Mr khtan,

Yes, i copy the whole code and run it once....
do i need to run it for every database or no need?
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17638 Posts

Posted - 04/02/2012 :  05:35:54  Show Profile  Reply with Quote
yes. You need to run it for every database that you required this function


KH
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000