[AccessD] Union Query WHERE Bug?

Jim Lawrence (AccessD) accessd at shaw.ca
Fri Apr 18 21:05:07 CDT 2003


MessageHi Myke:

The only reason is because the field with the number string has a space or
another invisible character in the field.
the 'like' operand will return any string with '8222' any where in it. If
the field was five characters in size it could return three possiblities of
'8222 ' or ' 8222' or '8222'.
WHERE (((quniCEIncompleteCredits.RepNum) Like "8222"));

you could try, to remove spaces:
WHERE (((trim(quniCEIncompleteCredits.RepNum))="8222"));

HTH
JIm
  -----Original Message-----
  From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Myke Myers
  Sent: Friday, April 18, 2003 12:53 PM
  To: accessd at databaseadvisors.com
  Subject: [AccessD] Union Query WHERE Bug?


  Can anyone explain why this query returns one record, as it should...

  SELECT quniCEIncompleteCredits.*
  FROM quniCEIncompleteCredits
  WHERE (((quniCEIncompleteCredits.RepNum) Like "8222"));

  And this query returns no records?.

  SELECT quniCEIncompleteCredits.*
  FROM quniCEIncompleteCredits
  WHERE (((quniCEIncompleteCredits.RepNum)="8222"));


  Using Access 2000. 'quniCEIncompleteCredits' is a union query.

  TIA,

  Myke
  The Better Information Group
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030418/ca5c245f/attachment-0001.html>


More information about the AccessD mailing list