query usung datedif function

D

drazlou

This is the sql view of a query that selects records greater than [enter
days] number of days from today. It returns records more than [enter days]
number of days from today but also returns records that are single digit
(1-9)days from today.

SELECT tblPayables.*, tblPayables.paid, DateDiff("d",[invoiceDate],Date())
AS Expr1, [enter days] AS Expr2
FROM tblPayables
WHERE (((tblPayables.paid)=No) AND
((DateDiff("d",[invoiceDate],Date()))>[enter days])) OR
(((tblPayables.paid)=No) AND (([enter days]) Is Null));
 
T

tina

try

SELECT tblPayables.* FROM tblPayables
WHERE tblPayables.paid=No AND (tblPayables.invoiceDate > Date()+[enter days]
OR [enter days] Is Null;

hth
 

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