2 DBs 1 giving a query error

B

Bob Vance

I have 2 Databases that are idenitical except for data, well i thought so
This query (Below) in one of the DB is erroring : "data type mismatchin
criteria expression"
So can it only be the table [tblOwnerInfo.OwnerID]??
Or should I look else where??

SELECT tblOwnerInfo.OwnerID, [OwnerLastName] & ", " & [OwnerFirstName] AS
OwnerName, nz([3],0) AS tb3Months0, nz([2],0) AS tb2Months0, nz([1],0) AS
tb1Month0, nz([0],0) AS tbCurrent0,
Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],3) AS tb3Months,
Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],2) AS tb2Months,
Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],1) AS tb1Month,
Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],0) AS tbCurrent,
qPayableTotalForPaymentwithTotal.Payable
FROM (tblOwnerInfo INNER JOIN qPayableTotalForPaymentwithTotal ON
tblOwnerInfo.OwnerID = qPayableTotalForPaymentwithTotal.OwnerID) INNER JOIN
qOverDueRep ON qPayableTotalForPaymentwithTotal.OwnerID =
qOverDueRep.OwnerID
ORDER BY [OwnerLastName] & ", " & [OwnerFirstName];
 
B

Bob Vance

Bob Vance said:
I have 2 Databases that are idenitical except for data, well i thought so
This query (Below) in one of the DB is erroring : "data type mismatchin
criteria expression"
So can it only be the table [tblOwnerInfo.OwnerID]??
Or should I look else where??

SELECT tblOwnerInfo.OwnerID, [OwnerLastName] & ", " & [OwnerFirstName] AS
OwnerName, nz([3],0) AS tb3Months0, nz([2],0) AS tb2Months0, nz([1],0) AS
tb1Month0, nz([0],0) AS tbCurrent0,
Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],3) AS tb3Months,
Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],2) AS tb2Months,
Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],1) AS tb1Month,
Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],0) AS tbCurrent,
qPayableTotalForPaymentwithTotal.Payable
FROM (tblOwnerInfo INNER JOIN qPayableTotalForPaymentwithTotal ON
tblOwnerInfo.OwnerID = qPayableTotalForPaymentwithTotal.OwnerID) INNER
JOIN qOverDueRep ON qPayableTotalForPaymentwithTotal.OwnerID =
qOverDueRep.OwnerID
ORDER BY [OwnerLastName] & ", " & [OwnerFirstName];
Tracked back to qOverDueRep (Code Below)and got the same error,

TRANSFORM Sum(qOwnerPercentAmountInPaymentMethodRep.AmountSummary) AS Dues
SELECT qOwnerPercentAmountInPaymentMethodRep.OwnerID
FROM qOwnerPercentAmountInPaymentMethodRep
GROUP BY qOwnerPercentAmountInPaymentMethodRep.OwnerID
PIVOT
iif(qOwnerPercentAmountInPaymentMethodRep.AmountSummary<0,3,IIf(MonthsDue([OnDate])>=3,3,IIf(MonthsDue([OnDate])>=2,2,IIf(MonthsDue([OnDate])>=1,1,0))));

qOwnerPercentAmountInPayment opened fine.....Thanks Bob
 

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

Similar Threads


Top