If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Time Stamp Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-04, 11:23
shelton shelton is offline
Registered User
 
Join Date: Dec 2004
Posts: 1
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.
Reply With Quote
  #2 (permalink)  
Old 12-01-04, 15:37
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
which database are you using? the sql will be different in every one
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-02-04, 15:24
joebednarz joebednarz is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On