I've had several problems with using dates in queries with Paradox and the HXTT drive. I'm not sure if this is a bug in my code, in Paradox itself, or in the driver. Perhaps you can help to clarify.
Following is an example of one such date problem.
The WHERE clauses specifies that only rows of a certain date should be returned but the query does in fact return all rows, no matter what the date is.
Thanks for your help.
System.out.println("------------------ history.emptime ---------------");
stmt=con.createStatement();
String query="SELECT T.employee_key, T.start_date, T.start_time, T.stop_date, T.stop_time, T.wage, E.first, E.last FROM history.emptime T LEFT JOIN config.employee E ON T.employee_key=E.employee_key WHERE T.start_date= {d'" + new SimpleDateFormat("yyyy-MM-dd").format(date) + "'}";
System.out.println(" About to execute query: " + query);
results=stmt.executeQuery(query);
while (results.next()) {
System.out.println(results.getInt("Employee_Key") + " start_date: " + results.getDate("start_date") + " start_time: "+ results.getInt("start_time") + " stop_date: " + results.getDate("stop_date") + " stop_time: " + results.getInt("stop_time") + " wage: " + results.getDouble("wage"));
}
stmt.close();
------------------ history.emptime ---------------
About to execute query: SELECT T.employee_key, T.start_date, T.start_time, T.stop_date, T.stop_time, T.wage, E.first, E.last FROM history.emptime T LEFT JOIN config.employee E ON T.employee_key=E.employee_key WHERE T.start_date= {d'2007-07-23'}
1002 start_date: 2006-05-31 start_time: 40486453 stop_date: 2006-05-31 stop_time: 40506906 wage: 1.0
1003 start_date: 2006-05-30 start_time: 27120000 stop_date: 2006-05-30 stop_time: 43027734 wage: 7.25
1003 start_date: 2006-05-31 start_time: 26697578 stop_date: 2006-05-31 stop_time: 54003296 wage: 7.25
1003 start_date: 2006-06-01 start_time: 27664171 stop_date: 2006-06-01 stop_time: 50578046 wage: 7.25
1003 start_date: 2006-06-02 start_time: 26606953 stop_date: 2006-06-02 stop_time: 38062109 wage: 7.25
1003 start_date: 2006-06-03 start_time: 26497078 stop_date: 2006-06-03 stop_time: 49947718 wage: 7.25
1003 start_date: 2006-06-04 start_time: 26460000 stop_date: 2006-06-04 stop_time: 49718421 wage: 7.25
1003 start_date: 2006-06-05 start_time: 27000000 stop_date: 2006-06-05 stop_time: 51660000 wage: 7.25
|
Also, I did reindex the two tables in this example (history.emptime and config.employee) and got the same result.
|
This issue is still unresolved. Can anyone suggest a solution or further questions?
|
We're still tring to recur your issue, but failed. If possible, you can zip and email webmaster@hxtt.com your db sample.
|
HXTT hasn't received more issue report from you, so that we guess that you have resolved your issue with the latest package.
|