I have the following javascript:
today = new Date(); //real "today" value if not using sample database
var curr_date = today.getDate();
var curr_month = today.getMonth();
curr_month++;
var curr_year = today.getFullYear().substr(2,2);
var t = curr_date + "/" + curr_month + "/" + curr_year;
this.queryText = this.queryText + " where exdate between '" + t + "' and '" + t + "'";
When I do this the query returns everything, but really, there is only 1 record between today and today.
If I manually write “between ‘8/9/12’ and ‘8/9/12′” then the query is fine. What is wrong here?
Thanks
today.getFullYear()returns a number, and a number doesn’t have the method.substr().