• I do things the same as McSQL, but one more thing i add is a check against a minimum date that is logical for the data on hand ; for example, the company I work at, in a certain table, would never have a date before the company existed; in another table, we logically would never have a date of birth for an employee over 100 years in the past.

    so the case is just a two condition item to avoid logical bad dates:

    CASE

    WHEN ISDATE(YOUR_FIELD) = 1 AND CONVERT(DATETIME,YOUR_FIELD,103) > '1989-04-15'

    THEN 0

    ELSE 1

    END

    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!