0 Replies - 443 Views - Last Post: 21 October 2014 - 11:22 AM

#1 DarenR   User is offline

  • D.I.C Lover

Reputation: 637
  • View blog
  • Posts: 4,226
  • Joined: 12-January 10

xml sql query

Posted 21 October 2014 - 11:22 AM

so ive never done a sql query in an xml and they want me to fix one that is messed up.

currently it is

SELECT PARMVALUE,SHORTDESC FROM (SELECT 'All' PARMVALUE, 'All' SHORTDESC, '1' SORTODER
UNION
SELECT PARMVALUE,SHORTDESC,'2' SORTORDER FROM PARAMTRS WHERE UPPER(TABLE_NAME) = 'USERBRDG' and UPPER(FIELD_NAME) = 'ST_INSPN_RESPBY_CD' )


however it brings back an element that is numbered 80
which i can remove by adding
AND PARMVALUE != '80' )


i have also tried
(case when PARMVALUE = '' then 'ALL' else PARMVALUE)
which it really hates

they want it so when when the report is pulled and there are no parameters put in they want the PARMVALUE default to 'ALL'

does anyone have any idea how to do this?

This post has been edited by DarenR: 21 October 2014 - 11:24 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1