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

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('2007/07/13', 'yyyy/mm/dd') AND CON_INITDATE < to_date('2007/08/14', 'yyyy/mm/dd')";

any suggestions would be greatly appreciated

Recommended Answers

All 4 Replies

instead of hardcoding the dates use sysdate and sysdate-30 for the desired output.

thanx...let me try that

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')";

im getting this error now java.sql.SQLException: ORA-01841: (full) year must be between -4713 and +9999, and not be

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.