C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Regarding Find Start Day and End day of the week...


Posted Date: 30 Aug 2008      Total Responses: 1

Posted By: sajan       Member Level: Bronze     Points: 1


Hi,
how can i find the week Start day and End Day for any given date..
Thanks & Regards,
S.Sajan.




Responses

Author: Karthikeyan S    30 Aug 2008Member Level: GoldRating:     Points: 6
Hi,

Following is the coding i developed and tested.

SELECT DATEADD(SS, -1,(DATEADD(D, 1 + 7-(SELECT DATEPART(DW, GETDATE())), (SELECT DATEADD(dw, (select datediff(dw,0,getdate())), 0))))) AS WeekFirstDate
SELECT DATEADD(SS, 1, (DATEADD(D, 1-(SELECT DATEPART(DW, GETDATE())), (SELECT DATEADD(dw, (select datediff(dw,0,getdate())), 0)))))
AS AS WeekEndDate

or for in single row:

SELECT DATEADD(SS, -1,(DATEADD(D, 1 + 7-(SELECT DATEPART(DW, GETDATE())), (SELECT DATEADD(dw, (select datediff(dw,0,getdate())), 0))))) AS WeekFirstDate,
DATEADD(SS, 1, (DATEADD(D, 1-(SELECT DATEPART(DW, GETDATE())), (SELECT DATEADD(dw, (select datediff(dw,0,getdate())), 0)))))
AS AS WeekEndDate



Post Reply
You must Sign In to post a response.
Next : retrieving query string value
Previous : DataList
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

it help desk

Contact Us    Privacy Policy    Terms Of Use