Hello,
I have a query that is run in Word VBA as part of an email mail merge function.
It has been working fine until this most recent change.
The left command seems to prevent any records from being returned.
If I removed the left command and have DNOTTYPE equal to the full value of the record instead of the first 2 letters, it works fine.
Any suggestions on why adding the LEFT command causes problems?
Thanks.
If at first you don't succeed, then sky diving wasn't meant for you!
I have a query that is run in Word VBA as part of an email mail merge function.
It has been working fine until this most recent change.
Code:
.OpenDataSource Name:=strDataSource & "\" & DocNameCut & ".dbf", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=" & strDataSource & ";" & _
"Mode=Read;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";" & _
"Jet OLEDB:Engine Type=18;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=" _
, SQLStatement:="SELECT * FROM `" & DocNameCut & "` WHERE EMAIL > '' AND LEFT(DNOTTYPE,2) = 'DE'", SQLStatement1:="", SubType:=wdMergeSubTypeAccess
The left command seems to prevent any records from being returned.
If I removed the left command and have DNOTTYPE equal to the full value of the record instead of the first 2 letters, it works fine.
Any suggestions on why adding the LEFT command causes problems?
Thanks.
If at first you don't succeed, then sky diving wasn't meant for you!