Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Iterate Months in a select statement
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Iterate Months in a select statement
Miscellaneous
Thread ID:
00562599
Message ID:
00562599
Views:
47
I need to make the cross-tab from hell ... again.

I get a starting date from a user. That is passed in adn I must Count() patients enrolled in a study on a monthly basis.

Jan Feb March April ...
1 1 3 5 the count increments as new pt's are added.


I am trying to do the count as a While loop in the fields section of a Select.

In simple terms I am dynamically building the dates from an @i

This test will not increment @i.

While @i <= @NoMonths
begin
print @i
set @i = @1+1
end

In VFP I'd just gomonth(xxx,1) but I cant seem to figue that one out. So how do I change the value of @i (numeric) in this simple loop?

TIA

__Stephen
Next
Reply
Map
View

Click here to load this message in the networking platform