Simple query

  • SELECT DISTINCT POLICYNUMBER WHERE STATUS='A' AND MonthReported < DATEADD(year,EffectiveDate,10)

    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!

  • SELECT DISTINCT PolicyNumber

    from GE_Transaction

    WHERE Status='A' AND MonthReported < DATEADD(year,EffectiveDate,10)

    i get the following error

    Server: Msg 8116, Level 16, State 1, Line 1

    Argument data type datetime is invalid for argument 2 of dateadd function.

  • SELECT DISTINCT PolicyNumber

    from GE_Transaction

    WHERE Status='A' AND MonthReported < DATEADD(year,10,EffectiveDate)

    i reversed the argument;

    i don't know that MonthReported is a valid date, you'll have to evaluate with data to see if this is valid.

    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!

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

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