Date calculation

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

Guest

I'm sure this is simple, but I can't bang my head on the desk anymore today! :0

I'm trying to query and show only dates within a 14 day range. The query
accesses the period end date off of a form (as you can see), since it's
attached to a macro that will print all my reports out at once.

So I input the last day of the period on the form and I want the query to
show me records between 14 days before date and date.

Formula :Between ("dateadd"=("y",-14,[Forms]![frmAddlPayrollReports]![PP End
Date Regular])) And [Forms]![frmAddlPayrollReports]![PP End Date Regular]

I get "Syntax error (comma) in expression".

help?!?! TIA!
 
jjacob,

Between [Forms]![frmAddlPayrollReports]![PP End Date Regular]-14 And
[Forms]![frmAddlPayrollReports]![PP End Date Regular]

Or, if you prefer...
Between DateAdd("d",-14,[Forms]![frmAddlPayrollReports]![PP End Date
Regular]) And [Forms]![frmAddlPayrollReports]![PP End Date Regular]
 
Thanks Steve, that worked like a charm. I knew it was simple syntax but I'm
a fiarly new user and just didn't get it.

Steve Schapel said:
jjacob,

Between [Forms]![frmAddlPayrollReports]![PP End Date Regular]-14 And
[Forms]![frmAddlPayrollReports]![PP End Date Regular]

Or, if you prefer...
Between DateAdd("d",-14,[Forms]![frmAddlPayrollReports]![PP End Date
Regular]) And [Forms]![frmAddlPayrollReports]![PP End Date Regular]

--
Steve Schapel, Microsoft Access MVP

I'm sure this is simple, but I can't bang my head on the desk anymore today! :0

I'm trying to query and show only dates within a 14 day range. The query
accesses the period end date off of a form (as you can see), since it's
attached to a macro that will print all my reports out at once.

So I input the last day of the period on the form and I want the query to
show me records between 14 days before date and date.

Formula :Between ("dateadd"=("y",-14,[Forms]![frmAddlPayrollReports]![PP End
Date Regular])) And [Forms]![frmAddlPayrollReports]![PP End Date Regular]

I get "Syntax error (comma) in expression".

help?!?! TIA!
 
Back
Top