Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

SQL-Weekly data Expand / Collapse
Posted Thursday, December 20, 2012 5:54 AM


Group: General Forum Members
Last Login: Friday, August 1, 2014 8:41 AM
Points: 101, Visits: 437
Hi All,

I have 2 date parameters say :

Calendar Start Date - 08/15/2012
Calendar End Date - 08/22/2012

I wanted to retrieve results of all the days i.e from Aug 13th - 19
and Aug 20th - 26th

say my sql table shld look like

Week Startday-Mon

08/13 - it shld contain data for thaht entire week from 13-19

08/20 -from 20-26

what ever date I select in custom calendar start n end date, the where clause should filter in such a way that display data weekly from the selected parameters.

Any help?
Post #1398931
Posted Friday, December 21, 2012 1:43 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 18, 2015 3:15 AM
Points: 56, Visits: 173
here is a good link

Once you get the first day of the week add no of days to that with the dateadd function to get the last day of your report.
Post #1399268
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse