Passing Calculated Field from a Form to a Query

B

Bill

I'm calculating the number of weeks between two dates on a
form using the datediff function "=DateDiff("ww",
[StartDate],[EndDate])", and I am displaying the correct
number of weeks on the form itself. But when I try to
place that field in a query, it shows up as an invalid
character, actually as a small square.

Can someone tell me how to get the calculated value to
appear as a legal piece of data?

Thanks.
 
J

John Vinson

Can someone tell me how to get the calculated value to
appear as a legal piece of data?

Generally, you don't. Storing it in a Table just risks data
corruption, since one of the underlying date fields can be changed,
making the result invalid.

Either recalculate it when needed, or put the calculation into the
query itself as a calculated field by typing

WeeksElapsed: DateDiff("ww", [StartDate], [EndDate])

in a vacant Field cell in your query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top