Query Criteria from excel file?

Paperclipper

Board Regular
Joined
Mar 11, 2004
Messages
110
Hi everyone! I am a novice at Access, and wanted to know if there was any better way to run a query that includes a long list of criteria...

The field is four character format, and I need all the records that are btwn 8400 and 9700 (does this include 9700? I assume not?), begin with the characters AC, and btwn H110 and H128...

I currently have something like the following in excel:

Like "AC*"
Between "8400" and "9700"
Between "H110" and "H128"

Is there anyway to do this without typing them all into the query design view? My list is actually about 100 different subsets...

Thank yoU!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,

Try this - you'll need to alter the column names to suit but you should get the drif

SELECT * FROM TableName where
columnNameOne like "AC*" and
(ColumnNameTwo >= "H110" and ColumnNameTwo <= "H128" and
ColumnNameTwo >= "8400" and ColumnNameTwo <= "9700")

Hope this helps!

Chris
 
Upvote 0

Forum statistics

Threads
1,221,657
Messages
6,161,084
Members
451,684
Latest member
smllchng5

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