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 |
MarleneLondt
Starting Member
1 Post |
Posted - 2010-08-27 : 01:22:53
|
HiIf anyone out there can help me to determine the 2nd working day of the month, I would really appreciate it! I also want to take public holidays into account when determining it. So say the first working day of the month is a Monday, but it is also a public holiday, the first working day moves to the Tuesdayd and the 2nd working day is then the Wednesday. Can anyone help?ThanksMarlene |
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2010-08-27 : 03:29:45
|
some hints. experiment and post your code so that we can advise further. we prefer you to learn by doing for yourself, but we will guide once we see you making an effort yourself.1. you need a "select top 2" construct2. you need an "order by datecol desc" construct3. you'll need to join to or use a table containing all days - marked as hol/work day.4. you may need to use datepart or dateadd in conjunction with the SQL function getdate to determine which months in the holiday/work table to use. |
|
|
|
|
|