Code for Parameter Query

  • Thread starter Thread starter Robin Chapple
  • Start date Start date
R

Robin Chapple

I have a query which produces a list of new members in the past seven
days using this ">Now()-7" in the criteria slot.

Currently I am running late, because of Christmas and New Year, and I
need to have a report for the previous 14 days. How do I write code so
that a parameter asks me to enter how many days?

Thanks,

Robin Chapple
 
I have a query which produces a list of new members in the past seven
days using this ">Now()-7" in the criteria slot.

Currently I am running late, because of Christmas and New Year, and I
need to have a report for the previous 14 days. How do I write code so
that a parameter asks me to enter how many days?

Thanks,

Robin Chapple

Now() might not be the best date function to use, as it has a time
value.
Do you really want to limit records to Jan 13 09:35:10 AM - 7 days?
What about a record entered at 8:15 AM that same morning 7 days ago.?
It won't show.

Try:
Date() - [How Many days?]
 
Thanks Fred,

I should have known better. I tripped up with that once before.

I will change it.

Robin

I have a query which produces a list of new members in the past seven
days using this ">Now()-7" in the criteria slot.

Currently I am running late, because of Christmas and New Year, and I
need to have a report for the previous 14 days. How do I write code so
that a parameter asks me to enter how many days?

Thanks,

Robin Chapple

Now() might not be the best date function to use, as it has a time
value.
Do you really want to limit records to Jan 13 09:35:10 AM - 7 days?
What about a record entered at 8:15 AM that same morning 7 days ago.?
It won't show.

Try:
Date() - [How Many days?]
 
Back
Top