need a date between MIN and MAX

  • I have a table that stores dates of records that need to be reprocessed. Normally I would use MIN function to pick up the earliest date I need processed. Lately i've been finding at least one date is out of the norm. So instead of picking up the min I'd like to pick up the next in line.

    For example, the first date is 20090104 (which min would give me), then 20100403 then 20100404,20100405 but i want to pick up the next one.

    This is a night time process and I won't know which dates are in the table so I can't hardcode. I'm only checking if the 1st date returned by the min is greater than 30 days from current day. Is there any way of doing this?

    Thanks,

    Ninel

  • Duplicate post

    Please post responses at http://www.sqlservercentral.com/Forums/Topic922422-338-1.aspx

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 2 posts - 1 through 1 (of 1 total)

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