[AccessD] Just cannot get this SQL syntax to work

Bill Benson (vbacreations) vbacreations at gmail.com
Thu Jun 24 08:06:39 CDT 2010


Thanks for trying to help Steve.

Still not resolved; here are the tests and the proof your recent two
attempts are not quite there.

The TblFilterList  Table's Contents are:
     Item
[MyField] = "ABA"""
[MyField] = "Aberdeen"
[MyField] = "ABERDN"
[MyField] = #2/1/2010#
[MyField] Between "A" AND "C"
[OtherField] = #2/1/2009#
[OtherField] = "CHARLES"


I paste in your query:
SELECT *
FROM TblFilterList
WHERE TblFilterList.Item Like "*[[MyField]] =*"

And I get the values with [OtherField] as well.


     Item
[MyField] = "ABA"
[MyField] = "ABERDN"
[MyField] = "Aberdeen"
MyField] = #2/1/2010#
[OtherField] = #2/1/2009#
[OtherField] = "CHARLES"

When I paste in your second Query, I get Items relative to only MyField, but
I get the BETWEEN item as well as the ones with "=". I only want the ones
with "="

SELECT *
FROM TblFilterList
WHERE Item Like "[[]M*"

     Item
[MyField] = "ABA"
[MyField] = "ABERDN"
[MyField] = "Aberdeen"
[MyField] = #2/1/2010#
[MyField] Between "A"" AND "C"





More information about the AccessD mailing list