Hi Friends,
I have a problem with a particular SQL query which I wrote.
Just to brief on the Tables involved.
Beneficiary
Solar Lantern No - Text, PK
Name of the Beneficiary - Text
Cost of Lantern - Number
Payment details table
Solar Lantern No - Text, FK
Payment - Number
The beneficiary has an option of making payments in installments.
this access application has a report option where we can see that overall outstanding payment report.
SELECT DISTINCTROW Beneficiary.[Solar Lantern No], Beneficiary.[Name of the Beneficiary], Beneficiary.[Name of the motivator], Beneficiary.Cos t_SL, Sum([Payment details].Payment) AS [Payment Received]
FROM Beneficiary LEFT JOIN [Payment details] ON Beneficiary.[Solar Lantern No]=[Payment details].[Solar Lantern No]
WHERE (Beneficiary.Co st_SL)-([Payment details].Payment)>0
GROUP BY Beneficiary.[Solar Lantern No], Beneficiary.[Name of the motivator], Beneficiary.[Name of the Beneficiary], Beneficiary.Cos t_SL;
This is query which i wrote. But when I execute the query, I find that there are some records which are displayed for which there is no outstanding. I am not able to figure out why. And these entries where made on a particular day.
Can anyone figure out where is the problem.
Looking forward to hear from you
sajit
I have a problem with a particular SQL query which I wrote.
Just to brief on the Tables involved.
Beneficiary
Solar Lantern No - Text, PK
Name of the Beneficiary - Text
Cost of Lantern - Number
Payment details table
Solar Lantern No - Text, FK
Payment - Number
The beneficiary has an option of making payments in installments.
this access application has a report option where we can see that overall outstanding payment report.
SELECT DISTINCTROW Beneficiary.[Solar Lantern No], Beneficiary.[Name of the Beneficiary], Beneficiary.[Name of the motivator], Beneficiary.Cos t_SL, Sum([Payment details].Payment) AS [Payment Received]
FROM Beneficiary LEFT JOIN [Payment details] ON Beneficiary.[Solar Lantern No]=[Payment details].[Solar Lantern No]
WHERE (Beneficiary.Co st_SL)-([Payment details].Payment)>0
GROUP BY Beneficiary.[Solar Lantern No], Beneficiary.[Name of the motivator], Beneficiary.[Name of the Beneficiary], Beneficiary.Cos t_SL;
This is query which i wrote. But when I execute the query, I find that there are some records which are displayed for which there is no outstanding. I am not able to figure out why. And these entries where made on a particular day.
Can anyone figure out where is the problem.
Looking forward to hear from you
sajit
Comment