• or did you mean the last non-null column, regardless of the datetime value? my example above finds the highest date, regardless of which column.

    in that case, assuming your app files the columns up in left to right order(timestamp1,imestamp2,imestamp3,imestamp4) it would be like this:

    SELECT

    ID,

    PO,

    COALESCE(timestamp4,timestamp3,timestamp2,timestamp1) AS MaxDate

    FROM [Dates]

    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!