#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Memphis
    Posts
    6
    Rep Power
    0

    SQL Plus Query question


    I am doing a data scrub query and I have most of it done except the following:
    I need to exclude all patients that have had a first shipment one month prior to the date this report will run.

    Please help!
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    60
    Rep Power
    12
    WHERE...

    patients.first_ship_date >= ADD_MONTHS(sysdate, -1)

    obv, left col has to be your own table and column, and the col must be an Oracle DATE data type. If it's a string containing some date representation, then wrap it with Oracle's TO_DATE(table.the_column, 'mm/dd/yyorotherformatspecifier')

IMN logo majestic logo threadwatch logo seochat tools logo