aspose file tools*
The moose likes JDBC and the fly likes Plz check the syntax: Whats wrong Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Plz check the syntax: Whats wrong" Watch "Plz check the syntax: Whats wrong" New topic
Author

Plz check the syntax: Whats wrong

Gorakshanath Pandey
Greenhorn

Joined: Feb 25, 2004
Posts: 11
selopen=" select count(*) from country "
+ "where region =" + "'" + temprs.getString("region") + "'"
+" and W_cmr = 'L' and closed_dt between " + "'"
+ dtrs.getDate("stdate") + "'" +" and "
+"'" + dtrs.getDate("eddate") + "'";
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
Are you getting a compile error? An SQL error? A JDBC error? no results back on the query? Please post the error you are receiving, and where/when it occurs.
Also, what database are you using? You have to be careful about how you specify dates on most databases: yours might not like a date to be specified as a quote-delimited string unless it's in a very specific format.
[ March 08, 2004: Message edited by: Wayne L Johnson ]
 
 
subject: Plz check the syntax: Whats wrong