Hi team,
I have an issue with the below SQL code I am using in VBA where the last line to find the wildcard of everything beginning with 0LC isn't coming up with results when I run the VBA.
When I run it in SQL Server Management it works and if in VBA I remove the last line, I can see results and there are cells beginning with 0LC so my only guess is something is wrong with the characters I am putting around the 0LC% within the VBA code?
I have an issue with the below SQL code I am using in VBA where the last line to find the wildcard of everything beginning with 0LC isn't coming up with results when I run the VBA.
When I run it in SQL Server Management it works and if in VBA I remove the last line, I can see results and there are cells beginning with 0LC so my only guess is something is wrong with the characters I am putting around the 0LC% within the VBA code?
VBA Code:
SQLQry = " select ST_ALOC_POINTER as 'Customer Code', ST_TRANTYPE as 'Transaction Type', ST_DESCRIPTION as 'Description', ST_GROSS as 'Local Amount', ST_CURRENCYCODE as 'Foreign Currency', ST_CURR_VALU as 'Foreign Currency Amount', ST_PERIODNUMBER as 'Period', ST_YEAR as 'Year'" & _
" from dbo.SL_TRANSACTIONS" & _
" where ST_YEAR = '" & Year & "'" & _
" and ST_PERIODNUMBER = '" & Period & "'" & _
" and ST_ALOC_POINTER like '0LC%'"