DateDiff w/ Parameter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The query calculates the difference between two dates and asks the user to
specify a minimum age.

The actual criteria is DateDiff("d",Date(),[Aging3]![Earliestdate])*-1

The criteria is [Minimum Age:]

If the actual number is put in the criteria, it works great. When the
user-specified parameter is employed, some, but not all, of the records
outside the range are included.

Any idea why?? And better yet, how to fix it?
Thanks!
ro
 
What you could do is have a column to display the entered value rather than
have it as a parameter. It might become clear when the query is run why the
values do not match (for example there might be a time component)
 
Another thing occured to me... This is a Summary Query based on several
nested queries. The Min Age was based on a "group by" and when I changed it
to a Max function, all is well. Not sure why but I will take it! Thanks for
your idea.
RO

JohnFol said:
What you could do is have a column to display the entered value rather than
have it as a parameter. It might become clear when the query is run why the
values do not match (for example there might be a time component)



RickOber said:
The query calculates the difference between two dates and asks the user to
specify a minimum age.

The actual criteria is DateDiff("d",Date(),[Aging3]![Earliestdate])*-1

The criteria is [Minimum Age:]

If the actual number is put in the criteria, it works great. When the
user-specified parameter is employed, some, but not all, of the records
outside the range are included.

Any idea why?? And better yet, how to fix it?
Thanks!
ro
 
Back
Top