query execution fail while using between in javascript (labkey query api method)

LabKey Support Forum (Inactive)
query execution fail while using between in javascript (labkey query api method) Matthew Bellew  2017-07-18 15:42
Status: Closed
 
Hi Atul, going back to your original code here could you try using variable for your generated SQL and then printing it out (or looking at it in the debugger).

e.g.

var sql = 'SELECT * FROM ' + Importantdata+
            +'where import_date between {ts \''+m_fro_date+'\'}' +' and {ts \'' +currentInsertDate+'\' }';
console.log(sql);
LABKEY.Query.executeSql({
               schemaName: 'DEMOSCHEMA',
               sql: sql,
        success: function(data){
        alert("YES!!");
      }
});

It would be helpful to know the exact SQL you are generating.