I have a TABLE called rpdnotification. Within rpdnotification is an INTEGER Field entitled rundate. rundate is the last date that the notification is supposed to run. In the TABLE rpdbullein is an INTEGER Field entitled notedate. notedate is the current entry day of the bulletin. Both dates are converted to and stored as Integers in the following format yyyymmdd.
i.e.
Field Value Table
Notedate 20040827 rpdbulletin
Rundate 20040830 rpdnotification
I need to generate the following SQL Statement: SELECT * FROM rpdnotification WHERE rundate >= notedate;
The code that I am trying to use is as follows:
NOTE - rsLog1 is the query results for rpdbulletin
<% // Get Notifications from rpdnotification
while (rsLog1.next()) {
int getnotedate = rsLog1.getInt("notedate");
rsLog1.cose();
// int getnotedate = 20040826; Test for my SQL Statement
sql2 = "select * from rpdnotification where rundate >= " + getnotedate;
Statement stmtLog2 = qedsys.createStatement();
ResultSet rsLog2 = stmtLog2.executeQuery(sql2);
DBResultSet drsLog2 = new DBResultSet(rsLog2);
while(rsLog2.next()) {
String subject = rsLog2.getString("subject");
String authority = rsLog2.getString("authority");
String narrative = rsLog2.getString("narrative");
String startdate = rsLog2.getString("startdate");
String rundays = rsLog2.getString("rundays");
%>
<tr>
<td height="25" colspan="6"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="123" height="25"><strong> Entered:</strong> <%=startdate%></td>
<td width="485" height="25"><strong> Subject: <%=subject%></strong></td>
<td width="152"><strong># of Days to Run:</strong> <%=rundays%></td>
</tr>
<tr>
<td height="25" colspan="3"><%=narrative%><%=getnotedate%> </td>
</tr>
<tr>
<td height="25" colspan="3"><strong> Authority: </strong><%=authority%></strong> </td>
</tr>
<tr>
<td height="25" colspan="3"> </td>
</tr>
<%
} // end of rsLog2 WHILE Loop
} // end of rsLog1 WHILE Loop
%>
With the following code I get no errors but nothing shows up.
Thanks.
i.e.
Field Value Table
Notedate 20040827 rpdbulletin
Rundate 20040830 rpdnotification
I need to generate the following SQL Statement: SELECT * FROM rpdnotification WHERE rundate >= notedate;
The code that I am trying to use is as follows:
NOTE - rsLog1 is the query results for rpdbulletin
<% // Get Notifications from rpdnotification
while (rsLog1.next()) {
int getnotedate = rsLog1.getInt("notedate");
rsLog1.cose();
// int getnotedate = 20040826; Test for my SQL Statement
sql2 = "select * from rpdnotification where rundate >= " + getnotedate;
Statement stmtLog2 = qedsys.createStatement();
ResultSet rsLog2 = stmtLog2.executeQuery(sql2);
DBResultSet drsLog2 = new DBResultSet(rsLog2);
while(rsLog2.next()) {
String subject = rsLog2.getString("subject");
String authority = rsLog2.getString("authority");
String narrative = rsLog2.getString("narrative");
String startdate = rsLog2.getString("startdate");
String rundays = rsLog2.getString("rundays");
%>
<tr>
<td height="25" colspan="6"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="123" height="25"><strong> Entered:</strong> <%=startdate%></td>
<td width="485" height="25"><strong> Subject: <%=subject%></strong></td>
<td width="152"><strong># of Days to Run:</strong> <%=rundays%></td>
</tr>
<tr>
<td height="25" colspan="3"><%=narrative%><%=getnotedate%> </td>
</tr>
<tr>
<td height="25" colspan="3"><strong> Authority: </strong><%=authority%></strong> </td>
</tr>
<tr>
<td height="25" colspan="3"> </td>
</tr>
<%
} // end of rsLog2 WHILE Loop
} // end of rsLog1 WHILE Loop
%>
With the following code I get no errors but nothing shows up.
Thanks.