Help on generating a report table having nulls

  • You may want to read this article. I don't know if this will help but its worth reading. I'm not an expert i'm just learning myself so here you go.

    http://www.sqlservercentral.com/columnists/jtravis/understandingthedifferencebetweenisnull.asp

  • Without seeing the query youhave, I'm not sure if I can help, but maybe a CASE statement will do the trick, something like this:

     
    
    SELECT
    [PO AMOUNT],
    [INVOICE AMOUNT] =
    CASE
    WHEN [POID]=(SELECT MIN([POID]) FROM Invoices ii WHERE ii.POID = i.POID)
    THEN [INVOICE AMOUNT]
    ELSE NULL
    END
    FROM Invoices i INNER JOIN PO p ON i.POID = p.POID

    I would really need to see some code to understand what you are doing.

    -Dan


    -Dan

  • Hi Everyone,

    I went back to the client and adjust business rules. Now the data contains the right relationships and the way the data was being stored is no longer applicable.

    Thanks for all your help

    JMC


    JMC

Viewing 3 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply