Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: Time Stamp Query

    I'm working in sql and I need a group of people who's have a certain timestamp - less than 14 days.

    AND B.ACT_REF_NMBR_ID = D.ACT_REF_NMBR_ID
    AND D.ACT_ST_CD = 'CPLT'
    AND B.FORM_RPT_CRET_STCD = 'RCRT'
    AND B.FORM_EFDT <= CURRENT DATE - 14 DAYS
    AND B.FORM_RPT_ID = C.FORM_RPT_ID
    AND B.FMRPT_CRETSTEFCVTS


    I need to calculate B.FMRPT_CRETSTEFCVTS

    I hope someone can help me. It is very, very important.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    which database are you using? the sql will be different in every one
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    If you are looking for a timestamp WITHIN the past 14 days (assume that is what you mean by "less than 14 days"), you would have write it like this:

    Code:
     AND B.ACT_REF_NMBR_ID = D.ACT_REF_NMBR_ID
    AND D.ACT_ST_CD = 'CPLT'
    AND B.FORM_RPT_CRET_STCD = 'RCRT'
    AND B.FORM_EFDT >= (CURRENT DATE - 14 DAYS)
    AND B.FORM_RPT_ID = C.FORM_RPT_ID
    AND B.FMRPT_CRETSTEFCVTS
    Your logic was backwards...
    JoeB
    save disk space, use smaller fonts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •