A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Criteria on "Like"



 
 
Thread Tools Display Modes
  #1  
Old July 3rd, 2007, 01:54 PM posted to microsoft.public.access.tablesdbdesign
acss
external usenet poster
 
Posts: 153
Default Criteria on "Like"

I am running a union query in which on export there is a workbook created and
two sheet are inserted. On one of these sheets i am using ((TT.InvDesc) Like
"AUDIT" & "*") yet i see some audit records on the other sheet which should
not be there.How do i ensure that the like statement will filter ALL records
with AUDIT within the description?
  #2  
Old July 3rd, 2007, 02:05 PM posted to microsoft.public.access.tablesdbdesign
Jason Lepack
external usenet poster
 
Posts: 600
Default Criteria on "Like"

LIKE "AUDIT*"
LIKE "*AUDIT"
LIKE "*AUDIT*"
= "AUDIT"




On Jul 3, 8:54 am, acss wrote:
I am running a union query in which on export there is a workbook created and
two sheet are inserted. On one of these sheets i am using ((TT.InvDesc) Like
"AUDIT" & "*") yet i see some audit records on the other sheet which should
not be there.How do i ensure that the like statement will filter ALL records
with AUDIT within the description?



  #3  
Old July 3rd, 2007, 06:18 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Criteria on "Like"

On Tue, 3 Jul 2007 05:54:01 -0700, acss wrote:

I am running a union query in which on export there is a workbook created and
two sheet are inserted. On one of these sheets i am using ((TT.InvDesc) Like
"AUDIT" & "*") yet i see some audit records on the other sheet which should
not be there.How do i ensure that the like statement will filter ALL records
with AUDIT within the description?


The criterion you're using will find all records where the first five letters
of the InvDesc field are AUDIT - followed by any string of zero or more
characters (that's what the wildcard * means).

If you want to find AUDIT anywhere within the field (e.g. if InvDesc were "All
the seats in the auditorium") use

LIKE "*AUDIT*"

or if you want to do it the hard way, but equivalently,

LIKE "*" & "AUDIT" & "*"


John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.