vendredi 5 février 2016

SQLite Query execution condition error

SQLite query was not showing the correct answer. What is the error in this query.

 "SELECT DISTINCT bike_reg_number from bookings WHERE vendor_id = '"+id+"' AND "+
            "bike_reg_number = '"+temp+"' AND (( from_date > '"+from_dt+"' AND from_date > '"+todt+"') OR "
                    + "(to_date < '"+from_dt+"' AND to_date < '"+todt+"'))";

My condition is,

(vendor_id must be there) and 
(bike_reg_number must be there) and
(from_date must be > the given both input from_dt and todt) or
(to_date must be < the given both input from_dt and todt)

Aucun commentaire:

Enregistrer un commentaire