Qry Formula help

C

Chad

Hello, in my query I have two fields and an expression.
1) EmployeeName
2) PeriodRatedTo
3) Expression= DueDate: DateAdd("d",-30,[PeriodRatedTo]) and a Criteria:
Date()

What I want the query to do is show the EmployeesName and the PeriodRatedTo
date but I want it to show only 30 days prior to the PeriodRatedTo date. I
keep getting no results... Is my formula wrong? thanks!
 
J

John W. Vinson

Hello, in my query I have two fields and an expression.
1) EmployeeName
2) PeriodRatedTo
3) Expression= DueDate: DateAdd("d",-30,[PeriodRatedTo]) and a Criteria:
Date()

What I want the query to do is show the EmployeesName and the PeriodRatedTo
date but I want it to show only 30 days prior to the PeriodRatedTo date. I
keep getting no results... Is my formula wrong? thanks!

Your formula will show only those records where today's date is exactly equal
to the date thirty days prior to PeriodRatedTo. If that date is yesterday or
tomorrow, you'll see nothing.

You can remove the expression DueDate altogether, and instead use a criterion
on PeriodRatedTo of

BETWEEN Date() AND DateAdd("d", 30, Date())

to see all PeriodRatedTo values coming up in the next thirty days.

John W. Vinson [MVP]
 
C

Chad

Im using it in a reminder pop up so how would I stop the reminder after the
PeriodRated to so it doesnt continue poping up? I found a example that using
a check box in the pop up for the record canceled it but I also want to stop
it as well in the query if possible..Thnaks!
--
Newbies need extra loven.........


John W. Vinson said:
Hello, in my query I have two fields and an expression.
1) EmployeeName
2) PeriodRatedTo
3) Expression= DueDate: DateAdd("d",-30,[PeriodRatedTo]) and a Criteria:
Date()

What I want the query to do is show the EmployeesName and the PeriodRatedTo
date but I want it to show only 30 days prior to the PeriodRatedTo date. I
keep getting no results... Is my formula wrong? thanks!

Your formula will show only those records where today's date is exactly equal
to the date thirty days prior to PeriodRatedTo. If that date is yesterday or
tomorrow, you'll see nothing.

You can remove the expression DueDate altogether, and instead use a criterion
on PeriodRatedTo of

BETWEEN Date() AND DateAdd("d", 30, Date())

to see all PeriodRatedTo values coming up in the next thirty days.

John W. Vinson [MVP]
 

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

Top