Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    13

    Unanswered: Change results in column to display different

    I have a column in the following select startement called displayvalue. Displayvalue is a varchar column. Primary everything entered into this column is numeric, but there are times when NR is entered. In the select query if it sees NR, I would like to have NR changed in the resultset to NULL or blank. NR doesn't come up all of the time, but I have not idea how to do this in the select statment.

    Here goes..

    SELECT SAMPLE.SAMPLEID, SAMPLE.U_WORKORDERNUMBER, SAMPLE.U_SAMPLEDATETIME, SDI.PARAMID, SDI.DISPLAYVALUE
    FROM SAMPLE SAMPLE, SDIDATAITEM SDI
    WHERE ( (SAMPLE.SAMPLEID = SDI.KEYID1) AND
    (SAMPLE.U_WORKORDERNUMBER = '0060') AND (SAMPLE.U_SAMPLEDATETIME > '31-DEC-2003') AND (SDI.PARAMID = 'BOD') )
    ORDER BY SAMPLE.SAMPLEID ASC, SDI.PARAMID ASC

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    SELECT SAMPLE.SAMPLEID, SAMPLE.U_WORKORDERNUMBER, SAMPLE.U_SAMPLEDATETIME, SDI.PARAMID,
    (CASE WHEN ISNUMERIC(SDI.DISPLAYVALUE) = 0 THEN Null
    ELSE SDI.DISPLAYVALUE END) SDI_DISPLAYVALUE
    FROM SAMPLE SAMPLE, SDIDATAITEM SDI
    WHERE ( (SAMPLE.SAMPLEID = SDI.KEYID1) AND
    (SAMPLE.U_WORKORDERNUMBER = '0060') AND (SAMPLE.U_SAMPLEDATETIME > '31-DEC-2003') AND (SDI.PARAMID = 'BOD') )
    ORDER BY SAMPLE.SAMPLEID ASC, SDI.PARAMID ASC
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •