Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help with SQL- stored proced 1

Status
Not open for further replies.

Happy2

Programmer
Aug 10, 2001
64
US
Please help with SQL- stored procedures

Can anyone please help me with the layout that a report in SQL should be like a cross tab style below: Thanks alot.

EXPECTED REPORT LAYOUT From 8/1/00 To 7/31/01

Developer Manager Agent Aug ... Jul
-------------------------------------------------
MICHELLE Anne Josh 3 0


This is the code I have to put in a temp table:
Declare @from int, @to int, @counter int, @Year int, @Month int
set @counter = 0
set @from = 1
set @to = datediff(mm, @StartDate, @EndDate)
While (@counter < @to + 1)
Begin
set nocount on
set @Year = Year(DateAdd(mm, -@counter, @EndDate))
set @Month = Month(DateAdd(mm, -@counter, @EndDate))
Insert into DateArray (Year, Month) values (@Year, @Month)
set @counter = @counter + 1
set nocount off
End
 

Looks like you're in the wrong forum. This is the Access SQL forum. Try forum183 for Microsoft SQL Server. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top