Criteria help

jcaptchaos2

Well-known Member
Joined
Sep 24, 2002
Messages
1,032
Office Version
  1. 365
Platform
  1. Windows
Have a query where I'm asking the person to enter a date that will pull data from a table for the date requested, my problem is the data in the table is stored like this. "4/14/2011 4:44:40 PM" when you look in the table it is formatted as Short Date so it looks ok but for the query criteria to work the person would have to type in "4/14/2011 4:44:40 PM" and really all I want then to have to type is "4/14" What can I do to correct this?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
In the query create a new field -

DateOnly:DateValue([OriginalDateFieldNameHere])


and then put the criteria on it instead of the original date field.

(personally I hate parameter prompts - I would have it so that they can use a form for input - then you can also make sure it is formatted correctly before they run the query and have problems).

Read this for more reasons why to avoid them:
http://www.tek-tips.com/faqs.cfm?fid=6763
 
Upvote 0
Ok thanks I will give it a try, the date field is using the =now() formula so it pulls the current date.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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