[AccessD] Like Operator SQL Syntax

Jim Lawrence (AccessD) accessd at shaw.ca
Thu Jun 5 09:33:32 CDT 2003


MessageHi Vlad:

I have a little piece of code that is stored with all my applications. When
set it writes a specific result string into memory. If there are some issue
the code can be pasted into a Access query or SQL  SP and tested there. It
makes it a lot easier to resolve tricky string problems. I could send it all
offline.

HTH
Jim
  -----Original Message-----
  From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of ACTEBS
  Sent: Thursday, June 05, 2003 7:56 AM
  To: access group
  Subject: [AccessD] Like Operator SQL Syntax


  Hi People,

  Can anyone tell me what wrong with the following syntax:

  strSQL = "SELECT tblCustomers.CustomerID, " _
              & "[tblCustomers]![CustomerNumber] & '-' &
[tblCustomers]![CustomerSite] " _
              & "AS CustCode, tblCustomers.CustomerName,
tblCustomers.Address1 & ' ' & " _
              & "tblCustomers.Address2 & ' ' & tblCustomers.Address3 & ' ' &
" _
              & "tblCustomers.Postcode AS Address, tblCustomers.DepotID FROM
tblCustomers " _
              & "WHERE (((tblCustomers.CustomerName) Like % + " _
              & strInput & " + %)) " _
              & "ORDER BY tblCustomers.CustomerName;"

  I am creating an ADO recordset and obviously ADO use % as the wild card
and not * so I am not sure where the issue currently is...

  Thanks
  Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030605/50eb78cb/attachment.html>


More information about the AccessD mailing list