944,181 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Unsolved
  • Views: 3803
  • Oracle RSS
Aug 15th, 2007
0

Trying to pull and display records from today back 30 days....

Expand Post »
Here's my code...basically, I hard coded yesterday just to make sure it works...Im trying to get it to display results everyday

java Syntax (Toggle Plain Text)
  1. String sqlStmt = "SELECT distinct count (lc.con_id) as TotalLeads FROM LEADS L inner join leads_contactinfo lc on l.fk_conid = lc.con_id" +
  2. " WHERE l.FK_CONID = lc.CON_ID AND lc.FK_AGENTID = ? AND CON_INITDATE > to_date('2007/07/13', 'yyyy/mm/dd') AND CON_INITDATE < to_date('2007/08/14', 'yyyy/mm/dd')";


any suggestions would be greatly appreciated
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
mimsc is offline Offline
70 posts
since Aug 2007
Aug 15th, 2007
0

Re: Trying to pull and display records from today back 30 days....

instead of hardcoding the dates use sysdate and sysdate-30 for the desired output.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Aug 15th, 2007
0

Re: Trying to pull and display records from today back 30 days....

thanx...let me try that
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
mimsc is offline Offline
70 posts
since Aug 2007
Aug 15th, 2007
0

Re: Trying to pull and display records from today back 30 days....

ok...I tried that...im not too savvy with sql....should it look like this?:

String sqlStmt = "SELECT distinct count (lc.con_id) as TotalLeads FROM LEADS L inner join leads_contactinfo lc on l.fk_conid = lc.con_id" +
" WHERE l.FK_CONID = lc.CON_ID AND lc.FK_AGENTID = ? AND CON_INITDATE > to_date('sysdate-30', 'yyyy/mm/dd') AND CON_INITDATE < to_date('sysdate', 'yyyy/mm/dd')";
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
mimsc is offline Offline
70 posts
since Aug 2007
Aug 15th, 2007
0

Re: Trying to pull and display records from today back 30 days....

im getting this error now java.sql.SQLException: ORA-01841: (full) year must be between -4713 and +9999, and not be
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
mimsc is offline Offline
70 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC