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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Day of Week Query

Author  Topic 

kevasp
Starting Member

2 Posts

Posted - 2009-01-04 : 12:32:17
I need help on for this query. How do you write a query to return following requirement field.

example
(Column)
date = '1/1/09', '1/2/09'
day = 1, 2
month =1 , 1
year =2009, 2009
dayName = 'Thursday', 'Friday'
monthName ='January', January'
businessDay = 'N', 'Y'
businessDayNumber = 0, 1
businessDaysElapsed = 0, 1
businessDaysInMonth = 20, 20
holiday = 'Y', 'N'
mondayWeek = 0, 0
sundayWeek = 0, 0

Sat and Sun is dayoff. Sunday is starting of Week 1 and Monday is Starting Week.


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-04 : 12:37:13
have a look at function DATEPART() and DATENAME() in books online.
http://doc.ddart.net/mssql/sql70/da-db_7.htm
http://doc.ddart.net/mssql/sql70/da-db_8.htm


For getting holiday,business day info, whaich all according to you represent business days and which holidays?
Go to Top of Page

kevasp
Starting Member

2 Posts

Posted - 2009-01-04 : 14:43:42
i got it
Go to Top of Page
   

- Advertisement -