in code, i am using .net repeater to get the data and I want the sum of the total application by SQL query,
SELECT sec.Id, Sec.Name as SName
,CASE WHEN SUM(DAS.Approved) IS NULL THEN 0 ELSE SUM(DAS.Approved) END as Approved
,CASE WHEN Sum(DAS.Pending) IS NULL THEN 0 ELSE SUM(DAS.Pending) END as Received
,CASE WHEN SUM(UnderProcess) IS NULL THEN 0 ELSE SUM(Process) END as UnderProcess
FROM [dbo].[Sectors] Sec
LEFT JOIN [dbo].[PMasters] AS A
ON Sec.Id = A.AltSectorId
LEFT JOIN D_AStatistics AS DAS
ON A.Id = DAS.ActivityID
GROUP BY Sec.Name,Sec.Id
order by 1
How I can I do?
Vishal JoshiPosted Apr 15, 2024, 12:50 PM
Hello,
The query given looks good. Please check the data and mapping. i.e. primary key and foreign key data before executing the query.
Thanks
Vishal Joshi
Jaimin ShethiyaPosted Apr 15, 2024, 12:25 PM
Hello Garima,
Try this one
Tahir AnsariPosted Apr 15, 2024, 12:06 PM
try this code