• MadRazzi (2/22/2013)


    what if ax2 through ax5 is null for a record

    wouldn't the case statement assign value 5 to POS?

    no.

    the case statement stops executing as soon as a match is found in the criteria is met.

    other items are not evaluated. and they are evaluated in the order you put in the order that the case statement is created.

    so it would return 2 in your example where 2-5 are null.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!