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

Reply

Join Date: Aug 2007
Posts: 66
Reputation: mimsc is an unknown quantity at this point 
Solved Threads: 0
mimsc mimsc is offline Offline
Junior Poster in Training

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

 
0
  #1
Aug 15th, 2007
Here's my code...basically, I hard coded yesterday just to make sure it works...Im trying to get it to display results everyday

  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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,131
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 131
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

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

 
0
  #2
Aug 15th, 2007
instead of hardcoding the dates use sysdate and sysdate-30 for the desired output.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 66
Reputation: mimsc is an unknown quantity at this point 
Solved Threads: 0
mimsc mimsc is offline Offline
Junior Poster in Training

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

 
0
  #3
Aug 15th, 2007
thanx...let me try that
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 66
Reputation: mimsc is an unknown quantity at this point 
Solved Threads: 0
mimsc mimsc is offline Offline
Junior Poster in Training

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

 
0
  #4
Aug 15th, 2007
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')";
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 66
Reputation: mimsc is an unknown quantity at this point 
Solved Threads: 0
mimsc mimsc is offline Offline
Junior Poster in Training

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

 
0
  #5
Aug 15th, 2007
im getting this error now java.sql.SQLException: ORA-01841: (full) year must be between -4713 and +9999, and not be
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Oracle
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC