query results

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

I have a query used to generate a production hours
forecast report which takes the product shipment date and
subtracts 7 days. If we are delivering within the first
week of a month, the production hours show up in the
previous month. I use a calculated field:
HoursDate:DateAdd("y",-7,[DeliveryDate])
I then use a parameter for that field:
=[Enter the beginning date:]
I do this so we can look further out without having to
view the current hours. It has worked fine for the first
9 months of the year, but as soon as you enter 10/1/2004
or later, it gathers all hours in the database, which
currently dates back to December 2003. It seems to
ignore the parameter entered.
Any help/suggestions are appreciated!
 
Dear Kevin:

Your calculation:

DateAdd("y",-7,[DeliveryDate])

will look back 7 years, not 6 days. Use:

DateAdd("d",-7,[DeliveryDate])

to calculate 7 days previous. See online help for the DateAdd
function for full details.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts


I have a query used to generate a production hours
forecast report which takes the product shipment date and
subtracts 7 days. If we are delivering within the first
week of a month, the production hours show up in the
previous month. I use a calculated field:
HoursDate:DateAdd("y",-7,[DeliveryDate])
I then use a parameter for that field:
=[Enter the beginning date:]
I do this so we can look further out without having to
view the current hours. It has worked fine for the first
9 months of the year, but as soon as you enter 10/1/2004
or later, it gathers all hours in the database, which
currently dates back to December 2003. It seems to
ignore the parameter entered.
Any help/suggestions are appreciated!
 
Back
Top