AnsweredAssumed Answered

How to use SELECT-CASE statement in NSQL ?

Question asked by suraj.rajendran on Aug 24, 2011
Latest reply on Aug 26, 2011 by Dave
Hi ,
Can you let me know How to use SELECT-CASE statement in NSQL ?

I have my regular SQL below section (1) and i need an equivalent syntax for the 2 SELECT CASE statement in bold ALONE in its corresponding NSQL :

so basically i want to know how to write select case statement in NSQL -Thanks

section(1) :

SQL :
SELECT
DISTINCT inv_investments.ID, odf_ca_project.ID,
CASE when odf_ca_task.BG_TASKQUALGATE=30 THEN prtask.prFinish END QG1_Actaul_date,
CASE when odf_ca_task.BG_TASKQUALGATE=70 THEN prtask.prFinish END QG4_Actaul_date,

odf_ca_task.ID, prtask.prprojectid,
inv_investments.name,odf_ca_cop_prj_statusrpt.cop_report_date,
inv_investments.STATUS_INDICATOR,
inv_investments.STAGE_CODE,
odf_ca_cop_prj_statusrpt.cop_phase,
odf_ca_project.bg_buslead,
odf_ca_project.bg_islead,
odf_ca_project.bg_nextqg_lookup,
prtask.prIsMilestone,
prtask.prIsKey,
odf_ca_task.bg_taskqualgate,
prtask.prstatus,
prtask.prFinish

FROM mun304d.inv_investments,
mun304d.prtask,
mun304d.odf_ca_project,
mun304d.odf_ca_task,
mun304d.odf_ca_cop_prj_statusrpt

WHERE ( (inv_investments.ID = prtask.prprojectid)
AND (prtask.prprojectid = odf_ca_project.ID)
AND (prtask.prprojectid = odf_ca_task.ID)
AND (prtask.prprojectid = odf_ca_cop_prj_statusrpt.ODF_PARENT_ID) and inv_investments.IS_ACTIVE <> 0 )

Outcomes