SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL-Weekly data


SQL-Weekly data

Author
Message
var05
var05
Mr or Mrs. 500
Mr or Mrs. 500 (547 reputation)Mr or Mrs. 500 (547 reputation)Mr or Mrs. 500 (547 reputation)Mr or Mrs. 500 (547 reputation)Mr or Mrs. 500 (547 reputation)Mr or Mrs. 500 (547 reputation)Mr or Mrs. 500 (547 reputation)Mr or Mrs. 500 (547 reputation)

Group: General Forum Members
Points: 547 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?
eklavu
eklavu
SSC Veteran
SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)

Group: General Forum Members
Points: 216 Visits: 173
here is a good link http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47307

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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search