G
Guest
I am using the following query to calculate membership fees in a period. The
query is returning an incorrect value of about half the true amount and I
can't work out why. I am using Access 2003 and an mdb database.
strSQL = "SELECT Sum(tblReceipts.ReceiptAmount) AS SumOfReceiptAmount" & _
" FROM (tblContacts INNER JOIN tblReceipts ON tblContacts.ContactID =
tblReceipts.ContactID)" & _
" INNER JOIN tblExtraDetails ON tblContacts.ContactID =
tblExtraDetails.UniqueID" & _
" WHERE ((tblReceipts.DateTime)> #" & varStartDate & "# And
(tblReceipts.DateTime)< #" & varEndDate & "#);"
Set qdf = CurrentDb.CreateQueryDef("", strSQL)
Set rstContact = qdf.OpenRecordset
If Not rstContact.EOF Then
curMFeeThMon = rstContact!sumofreceiptamount
Any help much appreciated
Thanks Paul Mendlesohn
query is returning an incorrect value of about half the true amount and I
can't work out why. I am using Access 2003 and an mdb database.
strSQL = "SELECT Sum(tblReceipts.ReceiptAmount) AS SumOfReceiptAmount" & _
" FROM (tblContacts INNER JOIN tblReceipts ON tblContacts.ContactID =
tblReceipts.ContactID)" & _
" INNER JOIN tblExtraDetails ON tblContacts.ContactID =
tblExtraDetails.UniqueID" & _
" WHERE ((tblReceipts.DateTime)> #" & varStartDate & "# And
(tblReceipts.DateTime)< #" & varEndDate & "#);"
Set qdf = CurrentDb.CreateQueryDef("", strSQL)
Set rstContact = qdf.OpenRecordset
If Not rstContact.EOF Then
curMFeeThMon = rstContact!sumofreceiptamount
Any help much appreciated
Thanks Paul Mendlesohn