Javascript string syntax to write SQL
- by sebastien leblanc
I am writing an SQL query as a Javascript string like that:
SQLdetail = 'SELECT [Avis SAP], Avis.[Ordre SAP], [Date Appel], [Heur Appel], Client_List![Code Client], [Numero Passerelle], [Designation Appel], Ordre![Metier], Ordre!Repercussion, Ordre!Objet, Ordre![Profil Panne], Ordre!Cause, Ordre![Sommaire Correctif], Ordre![Statut]'
SQLdetail += ' FROM (Avis'
SQLdetail += ' LEFT JOIN Client_List ON Avis.[Numero Client] = Client_List.[Numero Client])'
SQLdetail += ' LEFT JOIN Ordre ON Avis.[Ordre SAP] = Ordre.[Ordre SAP] WHERE Avis.[Date Appel] BETWEEN #' & DateOne & '# AND #' & DateTwo & '#;'
alert('SQLdetail:' + SQLdetail)
and the last SQLdetail += somehow returns "0". Am I missing something in the syntax that just turns the whole string to a 0?