Query question

cornishteeth

Board Regular
Joined
Dec 6, 2002
Messages
117
Newbie question. I have a query that contains 3 fields from a table. I want to have criteria for each of my fields, but I would like to skip a field criteria if I desire not to have that info injected into the query. For example, I have ShipName, ShipNumber, and Date. Under ShipName my criteria is

Like "*"+[Enter Ship Name]+"*".

Under ShipNumber I have [Enter Ship Number]

The query works if all criteria are met. If I do not want to enter one of the fields, how do I skip it without it affecting the output. If I just hit enter when the Input Box appears, the query does not work.

Examples: I enter ALEXANDRIA when Enter Ship Name appears and hit the enter key when Enter Ship Number appears. Query does not work. I enter ALEXANDRIA when Enter Ship Name appears and enter M4567 when Enter Ship Number appears. Query works. I hit enter when Ship Name appears and enter a Ship Number. Query does not work.

Another thing, I want to put in the Date field Between [start]and [stop]. Query does not work.

Any help would be great.

Cheers,

Cornish Teeth[/img]
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Here is what you can add in the criteria for your date field:
Between [Start] And [Stop]

As for your other question. Let me think on it for a while.
 
Upvote 0
I did use Between [Start] and [Stop] in the Date field and it did work, but unfortunately, mixed with the other criteria listed above, it didn't. Anyone else have any thoughts?????????


Cheers,

Cornish Teeth
 
Upvote 0

Forum statistics

Threads
1,221,531
Messages
6,160,366
Members
451,642
Latest member
mirofa

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