Compare Date In Sql Statement
I am making an alert tool using web sql. I want to selects all events that occur in a specific day. when I insert the event I insert the date as a date object with this format '201
Solution 1:
I believe you want:
NOTE_DATE = '"+cur.getFullYear()+'-'+(cur.getMonth()+1)+'-'+cur.getDate()+"'
Note the '
wrapping the value for the query variable, and calling the cur
date object's methods to construct the date.
Better yet, use a prepared query:
http://www.w3.org/TR/webdatabase/#dom-sqltransaction-executesql
Post a Comment for "Compare Date In Sql Statement"