Syntax error Q

J

John

Could anyone point out the mistake in the line below, its a syntax error,
I've a feeling its got to do with the 'FromDate' and 'ToDate' part

..CommandText = Array("SELECT tblSalesMixHistory.StoreNo,
tblSalesMixHistory.SalesDate, tblSalesMixHistory.Item,
tblSalesMixHistory.MenuSortName, tblSalesMixHistory.Sold" & Chr(13) & "" &
Chr(10) & "FROM `E:\History`.tblSalesMixHistory tblSalesMixHistory" &
Chr(13) & "" & Chr(10) & "WHERE (tblSalesMixHistory.Item=100) AND
(tblSalesMixHistory.SalesDate>={ts '" & (FromDate) & "'} And
tblSalesMixHistory.SalesDate<={ts '" & (ToDate) & "'}) AND
(tblSalesMixHistory.Item=101) AND (tblSalesMixHistory.SalesDate>={ts '" &
(FromDate) & "'} And tblSalesMixHistory.SalesDate<={ts '" & (ToDate) & "'})
AND (tblSalesMixHistory.Item=102) AND (tblSalesMixHistory.SalesDate>={ts '"
& (FromDate) & "'} And tblSalesMixHistory.SalesDate<={ts '" & (ToDate) &
"'})" & Chr(13) & "" & Chr(10) & "ORDER BY tblSalesMixHistory.StoreNo,
tblSalesMixHistory.SalesDate, tblSalesMixHistory.Item")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top