Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display parameter value in query result? 1

Status
Not open for further replies.

GaborH

Technical User
Nov 5, 2003
48
US
I would like to display the "parameter value" in the result of a query. This would enable me to do a "datediff" calculation against one constant (the parameter value) and a variable associated with each record. Any help is highly appreciated.
 
You can use parameters almost anywhere in your query expressions. For instance:
NumMonths: DateDiff("m", [Enter Start Date], [DateField])
You can also use the parameter by itself in a column:
StartDate:[Enter Start Date]

Duane
MS Access MVP
 
Thank you! I took the input from the parameter value and used it to limit an existing date field instead of creating a new field, i.e. [Enter Sart Date].

I do not know how I missed that! Thank you again!
 
I think I may have jumped the gun on this one.
In the above example, I presume that [Enter Start Date] must first be defined in the table. This I have done, with no values. However, I cannot get the parameter value to appear as a constant with each record. I know that in the column with the "where" expression is not to be visible, but placing [Enter Start Date] on the next column over with the visibility box check is no help either.

What I am hoping to do is calculate a weekly "burn rate" for a number of projects. The projects have various ending times, but instead using their respected start dates, I hope to use a date that is entered via a parameter value. Any help is highly appreciated!
 
You don't need a field in the table. I could only repeat what I stated in my first post. I just tested this and the query accurately created a column named StartDate with the date I entered displayed for every record.

Duane
MS Access MVP
 
Doesn't need to be in the table. Add a column to your query.
Field StartDate: [Enter start date]
Criteria [Enter start date]
Make Visible
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top