Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Convert SQL CASE Statement to If Then Else

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Convert SQL CASE Statement to If Then Else
 Login/Join
 
Member
posted
Hi
Below code is sql code ,i want to convert this to webffocus if then else code

can any one help me

CASE
WHEN MONTH (END_DT) = MONTH (TGT_RUN_FINAL_TS) THEN MONTH (END_DT)
WHEN (TGT_RUN_FINAL_TS) <= [NEXT_DAY [NEXT_DAY [[VALUES TGT_RUN_FINAL_TS - [DAY [TGT_RUN_FINAL_TS) -1) DAYS), 'FRIDAY'),'FRIDAY'))
AND (TGT_RUN_FINAL_TS) > (NEXT_DAY (NEXT_DAY ((VALUES TGT_RUN_FINAL_TS - (DAY (TGT_RUN_FINAL_TS) -1) DAYS), 'FRIDAY'),'FRIDAY')-1 MONTH)
AND (MONTH (END_DT)) <> (MONTH (TGT_RUN_FINAL_TS)) THEN MONTH (TGT_RUN_FINAL_TS-15 DAYS)
ELSE
MONTH (TGT_RUN_FINAL_TS)
END
AS REPORT_MONTH

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 7 | Registered: January 09, 2013Report This Post
Expert
posted Hide Post
This should eb simple.


General Rules.
[LIST]
  • Add REPORT_MONTH/{format} = to the start
  • Lose the CASE
  • Change WHEN to IF
  • Change =,<=,> etc to EQ LE, GT, etc
  • Every IF needs a THEN and an ELSE.
  • Loose the END
  • Add a semicolon to the end.

    If this is in a TABLE FILE you will need the COMPUTE command before it.


    Waz...

    Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
    In Focus since 1984
    Pity the lost knowledge of an old programmer!

  •  
    Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
    Master
    posted Hide Post
    WTF ???

    Waz - one of the resident true geniouses - goes to all the trouble of replying to the original post and then you delete it ????


    WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
     
    Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
    Expert
    posted Hide Post
    Hi kumar27,

    Please do not delete the content of your original posts. You can make edits as needed, just do not totally remove the content.

    I will see if I can recover the original content.

    Cheers,

    Kerry


    Kerry Zhan
    Focal Point Moderator
    Information Builders, Inc.
     
    Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
      Powered by Social Strata  

    Read-Only Read-Only Topic

    Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Convert SQL CASE Statement to If Then Else

    Copyright © 1996-2020 Information Builders