Problem with using parameter in query with calculation from date

MsT

New Member
Joined
Mar 17, 2003
Messages
37
Hi

I have a database with a Date of Birth field. I have a query with a field that calculates the age from the Date of Birth (DateDiff("yyyy",[Date of Birth],Date())+Int(Format(Date(),"mmdd")<Format([Date of Birth],"mmdd")) and it works fine

As a criteria in this field I want to be able to select a minimum age. It works fine when I do, for example >=9. However when I do >=[ ] instead, the query does not work - it treats it as =[]

Anyone have any ideas about this?

Thanks in advance
Fran
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
it needs a value in there, or a way of divining a value otherwise i can't calculate
 
Upvote 0
Sorry I don't quite understand your comment - usually when I construct parameter queries I simply use the square brackets (usually with a prompt inside such as [Please enter a maximum value] and the query asks for a value when it runs, then uses that.

When I run this query, it prompts as usual but then does not use the number I enter in the right way
 
Upvote 0
i misunderstood your question, i have no answer then
 
Upvote 0

Forum statistics

Threads
1,216,085
Messages
6,128,733
Members
449,465
Latest member
TAKLAM

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