Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shift month numbers for FY start
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00929339
Message ID:
00929382
Vues:
13
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform