Begins With Query

Ed68

New Member
Joined
Oct 5, 2005
Messages
27
Hi Guys,

Can anyone advise me whether there is a 'begins with' option I can add into the Criteria field when running a query....similar to the filter facility on excel.

I am building a query where I need to see more than just the first two numbers so cannot use the <> function.

I hope that this is clear and any assistance you can provide would be much appreciated.

Cheers,
Ed
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
If you mean (I don't know Excel that well) you want to start with number 15 and see all the numbers from there until 83, then you can use "Between 15 and 83" Of course 15 and 83 here are example numbers.
HTH,
 
Upvote 0
Ed

You could use Like and wildcards.

For example try this in the criteria.

Like "A*"

That should return all records where that field begins with A.

If that's not what you are looking for more detail and/or an example might help.:)
 
Upvote 0
Guys,

Thanks for the responses.

Norie - That works great and really helps me - thanks a lot.

Ed
 
Upvote 0
Ed

No problem, post back if you need further help.

Here's another example.

Like "[A-E]*"

That will return all records where the field begins with A,B,C,D or E.
 
Upvote 0
Like "A*"

I did a search and found this topic. I used a couple of the expressions mentioned above and they worked perfectly for what I was needing.

In an attempt to learn more about Access, what is the signifcance of the * after the A? I know some of the other expressions I have used returned the results fine w/o it, but in this particular case, nothing worked until I put in the *.

Thanks
 
Upvote 0
The * is a "wildcard". So, what you posted, Like "A*" means give me everything that starts with an A and is followed by anything.
 
Upvote 0

Forum statistics

Threads
1,223,098
Messages
6,170,100
Members
452,301
Latest member
QualityAssurance

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top