This is such a simple issue that I feel quite embarrassed to put it into print. I have an SQLite database where I want to retrieve data with a conditional WHERE. The WHERE condition refers to a numeric field. If I insert the actual value it works fine, but the moment I use a numeric variable it gives me a syntax error. This works -
rs = App.DB.SQLSelect(“SELECT MAX(Glucometer) AS MaxGluc FROM Carbcalc WHERE Minutes > (1061254490 - 43776)”)
This does not - rs = App.DB.SQLSelect(“SELECT MIN(Glucometer) AS MinGluc FROM Carbcalc WHERE Minutes > '” + TotMins_Month + “’”)
I’d really appreciate being put right on this one. many thanks, guys.