date poser

L

Lapchien

2 tables, 2 fields, both dates. both show dates of payments - 1 expected
date, the other actual. The 'actual' date is always a few days further on
than the 'expected' date. I need a query that compares the results of both
dates, and shows a message box if any differences are, say, more than 2
weeks apart..?
 
G

Gerald Stanley

Try something along the following lines

SELECT <yourtable1.yourdate1> , <yourtable2.yourdate2>
FROM <yourtable1> INNER JOIN <yourtable2> ON <yourrelationship>
WHERE DateDiff("d", <yourtable1.yourdate1>,
<yourtable2.yourdate2>) > 14

You will have to fill in your table and date names and the
relationship between the two tables. The above assumes
that you mean 14 days. You should refer to the Help on the
DateDiff function if you want to employ a different
definition of week (e.g the number of Mondays between two
dates)

Hope That Helps
Gerald Stanley MCSD
 
J

John Vinson

2 tables, 2 fields, both dates. both show dates of payments - 1 expected
date, the other actual. The 'actual' date is always a few days further on
than the 'expected' date. I need a query that compares the results of both
dates, and shows a message box if any differences are, say, more than 2
weeks apart..?

Put a calculated field in the Query:

DaysToPayment: DateDiff("d", [Expected], [Paid])

This will be an integer number of days; you can put a criterion on the
field of

to find all payments over two weeks old.

To catch those records that haven't been paid yet at all, use

NZ([Paid], Date())

instead of [Paid].
 

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