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
Miscellaneous
Thread ID:
00562599
Message ID:
00562610
Views:
20
Thanks! That's it.

__Stephen




>Would DateAdd() help?
>
DateAdd(mm, 1, myDate)
>This would return myDate with 1 month added.
>
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform