web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

SLB CASE statement to convert periodid to Month

(0) ShareShare
ReportReport
Posted on by 315

Hi, All - Can anyone give me any help as to how to make my CASE statement for changing the periodid from 1 to JAN in the calculated fields section of SLB?  Here is what I've come up with (don't laugh, I'm just an accountant who dabbles in sql) and it doesn't work.  Thanks!!  Kathryn

CASE {Account Summary History View:Period ID}
WHEN '1' THEN 'JAN'
WHEN '2' THEN 'FEB'
WHEN '3' THEN 'MAR'
WHEN '4' THEN 'APR'
WHEN '5' THEN 'MAY'
WHEN '6' THEN 'JUN'
WHEN '7' THEN 'JUL'
WHEN '8' THEN 'AUG'
WHEN '9' THEN 'SEP'
WHEN '10' THEN 'OCT'
WHEN '11' THEN 'NOV'
WHEN '12' THEN 'DEC'
ELSE 'ERROR'
END AS [MONTH]
 from DYCUN..GL11111 GL11111

*This post is locked for comments

I have the same question (0)
  • Richard Wheeler Profile Picture
    75,852 Moderator on at

    Try

    SELECT CASE (PeriodID)

    WHEN '1' THEN 'JAN'

    WHEN '2' THEN 'FEB'

    WHEN '3' THEN 'MAR'

    WHEN '4' THEN 'APR'

    WHEN '5' THEN 'MAY'

    WHEN '6' THEN 'JUN'

    WHEN '7' THEN 'JUL'

    WHEN '8' THEN 'AUG'

    WHEN '9' THEN 'SEP'

    WHEN '10' THEN 'OCT'

    WHEN '11' THEN 'NOV'

    WHEN '12' THEN 'DEC'

    ELSE 'ERROR'

    END AS [MONTH]

    from TWO..GL11111

     

    Do not use Curly brackets use parentheses. Now what about the GL account number?

  • KATHRYN HILL Profile Picture
    315 on at

    I tried it but I got an error saying There is an error in the calculated field.[Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'SELECT'.

  • Jothi Krishnan N Profile Picture
    1,897 on at

    Open your Smartlist report in SLB and click Options >>Display SQL >> and mark all 3 options at the bottom of the screen. now copy the SQL statement generated and  try running it in the backend and see if you can figure out, or post it here for someone to check.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans