Rob has attended:
Excel VBA Advanced course
SQL statement - syntax for filtering by multiple fields
I am trying to build a sheet from a Access table using the SQL stement and using more than one filter...my proposed line of code is...
Const SQL As String = _
"SELECT CompanyCode, AccountCode, CentreCode, Level3Code, YTD_Ccy FROM tblPvtLink WHERE CompanyCode = 'MAINCO' & CentreCode = '7380' , '7302' ORDER BY AccountCode"
Where have I gone wrong with the filtering syntax?
Cheers
Rob
RE: SQL statement - syntax for filtering by multiple fields
I should have used the AND OR functions here...
But for some reason when I try and filter out zero balances by adding YTD_Ccy <> 0 it doesn't work, unless it is the only filter criteria...please advise
Cheers
Rob
RE: SQL statement - syntax for filtering by multiple fields
Hi Rob
Thanks for the question
Can you clarify for me whether the YTD field contains a value that is entered into a table, or whether it is the result of a calculation in a query?
Thanks
Stephen