In following example i'm getting daily totals. I need to get cumulative totals relevant to the DPetAcNo.
SELECT
DPetAcNo as AcNo,
SUM(DPetAmount) as PetTotal
FROM PettyDetail
WHERE DPetComCode='15'
and DPetLocCode='01'
and DPetDate=CONVERT(date,'20181113',111)
group by
DPetAcNo