Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shift month numbers for FY start
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00929339
Message ID:
00929382
Views:
14
>Mike,
>
>Try
SET @RealMonth = (@MonthNum + @fystart - 1) % 12
>CASE @RealMonth WHEN 0 THEN 12 ELSE RealMonth END
>
>
Uhh... OK, but how do I include that within my TSQL select command...

Is it something like this:
SET @RealMonth = (@MonthNum + @fystart - 1) % 12
CASE @RealMonth WHEN 0 THEN 12 ELSE RealMonth END
SELECT     STR(@RealMonth, 2, 0) + ' - ' + MonthName AS DisplayValue, STR(@RealMonth, 2, 0) AS cValue
FROM         SelectLists
... or does the SET... END statement belong within the SELECT somehow? (Pardon my neophite SQL status)
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform