SELECT DateDiff("n", LastDate, Now()) as datediffs FROM UserLog WHERE ID = 1
When I execute this query from Query Design View (MS Access). This give me different in minutes well like this:
datediffs --------- 2826
But when I execute the same query (including static value in where condition ID = 1) from servlet like this:
strSql = "SELECT DateDiff(\"n\", LastDate, Now()) as datediffs FROM UserLog WHERE ID = 1";
recset=stmt.executeQuery(strSql);
It gives me the following error:
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
So what wrong with me?