T
tamxwell
This query is for agings debts. I want only to pull the records that are 1-45
days old. I've tried a number of ways ,but it still gives me all 56000
records instead of "just what is 1-45". Here is my query
SELECT
tblARDetail.[co-number] AS Branch, tblARDetail.[divn-number] AS SubBranch,
tblARDetail.[cust-number] AS CustomerNumber, tblARDetail.[cust-name] AS
CustomerName, [tblARDetail]![trans-code] & [tblARDetail]![item-type] AS
TranType, tblARDetail.[ref-number] AS ReferenceNumber,
tblARDetail.[as-of-date], tblARDetail.[due-date], tblARDetail.[item-amount],
Now() AS Today,
DateDiff("d",[Due-Date],[Today]) AS DSO,
IIf([item-amount]<0,0,IIf(([DSO])<45 And ([DSO])>1 ,[item-amount],0)) AS
[1-45],
tblCustusage.CA, tblCustusage.CM
FROM tblARDetail INNER JOIN tblCustusage ON (tblARDetail.[co-number] =
tblCustusage.Company) AND (tblARDetail.[cust-number] = tblCustusage.Acct)
ORDER BY tblARDetail.[co-number], tblARDetail.[divn-number],
tblARDetail.[cust-number], tblARDetail.[as-of-date];
days old. I've tried a number of ways ,but it still gives me all 56000
records instead of "just what is 1-45". Here is my query
SELECT
tblARDetail.[co-number] AS Branch, tblARDetail.[divn-number] AS SubBranch,
tblARDetail.[cust-number] AS CustomerNumber, tblARDetail.[cust-name] AS
CustomerName, [tblARDetail]![trans-code] & [tblARDetail]![item-type] AS
TranType, tblARDetail.[ref-number] AS ReferenceNumber,
tblARDetail.[as-of-date], tblARDetail.[due-date], tblARDetail.[item-amount],
Now() AS Today,
DateDiff("d",[Due-Date],[Today]) AS DSO,
IIf([item-amount]<0,0,IIf(([DSO])<45 And ([DSO])>1 ,[item-amount],0)) AS
[1-45],
tblCustusage.CA, tblCustusage.CM
FROM tblARDetail INNER JOIN tblCustusage ON (tblARDetail.[co-number] =
tblCustusage.Company) AND (tblARDetail.[cust-number] = tblCustusage.Acct)
ORDER BY tblARDetail.[co-number], tblARDetail.[divn-number],
tblARDetail.[cust-number], tblARDetail.[as-of-date];