Solved

Access Expression Builder - Like & Not Like

Posted on 2011-09-19
3
624 Views
Last Modified: 2012-06-21
Hi there,

I have the following scenario going in expression builder.

I want to sort a column for certain strings (say type 'A') but not for 'B'

The current formula I have is not working

Like (getstring([Forms]![Input]![txt1]) & "*") not like (getstring([Forms]![Input]![txt2]) & "*"

Open in new window


Any help is much appreciated!
0
Comment
Question by:Shanan212
  • 2
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 36560638
try


Like (getstring([Forms]![Input]![txt1]) & "*") AND not like (getstring([Forms]![Input]![txt2]) & "*"
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 500 total points
ID: 36560645
or this




[FieldName] Like (getstring([Forms]![Input]![txt1]) & "*") AND [FieldName] not like (getstring([Forms]![Input]![txt2]) & "*"
0
 
LVL 13

Author Closing Comment

by:Shanan212
ID: 36560728
You just saved me a whole lot of time by switching to Expers Exchange!

Cheers!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question