April 18, 2009 at 9:02 am
I have to display data between two dates week by week. It should display Monday to Sunday.
TableA
SnoSnameDate
1A04/01/09
2B04/02/09
3C04/03/09
4D04/04/09
5E04/05/09
6F04/06/09
7G04/07/09
8H04/08/09
9I04/09/09
10J04/010/09
11K04/011/09
Example: I have to pass two variables to stored procedure. They are @startdate and @enddate.
Exec Stprocedure ‘04/01/09’ ‘04/11/09’
It should display
1st week Details
SnoSnameDate
1A04/01/09
2B04/02/09
3C04/03/09
4D04/04/09
5E04/05/09
2nd week Details
SnoSnameDate
6F04/06/09
7G04/07/09
8H04/08/09
9I04/09/09
10J04/010/09
11K04/011/09
Because this month started with Wednesday, that’s why it should display wed to sun for 1st week and Monday to Sunday for 2nd week.
It should display for all the weeks between two dates.
April 18, 2009 at 10:19 am
May I ask why you need to do this in the stored procedure? This is something that really should be done by the front end application or report, not on the database side.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply