my dog learned polymorphism*
The moose likes JDBC and the fly likes pass a varble in WHERE clause instaed of a constant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "pass a varble in WHERE clause instaed of a constant" Watch "pass a varble in WHERE clause instaed of a constant" New topic
Author

pass a varble in WHERE clause instaed of a constant

naveen yadav
Ranch Hand

Joined: Oct 23, 2011
Posts: 384

hi ranchers ,

i'm developing a application in JavaScript for TItanium(Android) where i need to execute a query something like :
i had number of rows in database with same date so i need to figure out that for each date how many rows are there
let say

above is working fine it is returing 2 rows

but i need to pass date in a variable like


its not working as desired returning 0 rows.how can i resolve this?
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 866
    
    5
You might have forgotten the apostrophes that delimit a string literal.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: pass a varble in WHERE clause instaed of a constant
 
Similar Threads
Convert to timestamp yyyy-MM-dd hh:mm:ss a
Performence issue:Write query directly in session bean or call storted procedure
Dates between different databases
calculating difference between two dates in access
Select date field problem