Results 1 to 3 of 3

Thread: Why can't I there be a # in the data?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Colorado, USA
    Posts
    18

    Post

    When the record I want to return contains a # in the criteria the recordset returns no records
    for instance cFind = "Jones Store #1" or
    cAddr = "6151 Freeport Blvd. #180"

    SQL$ = "select [Company], [Address1], [Address2], [City State Zip] from [ShipTo] where [Company] like '" & cFind & "' and Address1 like '" & cAddr & "'"
    Data3.RecordSource = SQL$

    Any ideas on how to get it to recognize and return the records will be much appreciated.
    Thanks!

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Have you tried this?

    SQL$ = "select [Company], [Address1], [Address2], [City State Zip] from [ShipTo] where [Company] like '[" & cFind & "]' and Address1 like '[" & cAddr & "]'"

    ------------------
    Marty

  3. #3
    Junior Member
    Join Date
    Jan 2000
    Location
    Christchurch, New Zealand
    Posts
    19

    Post

    I may have missed what you were getting at, but I think the # is a 'key' symbol in Access SQL. It is usually enclosed around dates and therefore may not be able to be used in the way you are attempting

    Cheers Dave
    aka Lil Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width