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.
Author |
Topic |
ams006
Yak Posting Veteran
55 Posts |
Posted - 2010-08-10 : 06:17:43
|
Hi All, Does anyone know of a quick way in T-SQL to calculate the number of working days between to datetime fields? Thanks in Advanceams006 |
|
paulwfromtheden
Starting Member
9 Posts |
Posted - 2010-08-10 : 06:19:27
|
I guess the question is "what is a working day?". The only way that we have solved this is with a table of bank holidays |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2010-08-10 : 06:20:52
|
How do you define "working days'?Do you have a calendar table where you define your days?Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2010-08-10 : 06:23:03
|
Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH |
 |
|
ams006
Yak Posting Veteran
55 Posts |
Posted - 2010-08-10 : 06:36:15
|
No I don't have a calendar table. I am trying to find the number of days (excluding weekends) between two datetime fields from two different tables. Do i need to set up a 'calendar table', if so how do i do that? what does it need to hold? Thanks |
 |
|
ams006
Yak Posting Veteran
55 Posts |
Posted - 2010-08-10 : 06:56:59
|
It's ok guys and girls, not needed anymore as User has just told me they want all days (not just working days)! typical!Thanks anyway. |
 |
|
|
|
|