Forum Discussion
Tony2021
Jul 08, 2022Iron Contributor
Sum between 2 dates
Hello Experts, I need to sum [AmountOrig] but only for a specified date range. Please see bold below. Its not correct since it returns NULL. I am not entirely certain if Dsum is what I need though ...
- Jul 09, 2022your Criteria on Dsum() should be one expression:
DSum("AmountOrig","tblFXparent","Vendor = '" & [Vendor] & "' And DateSettle Between #5/20/2021# And #9/15/2021#") AS FCNotionals
or you can create a separated Aggregate query and join it with your first query:
select Vendor, Sum(AmountOrig) As FCNotionals From tblFXParent where DateSettle Between #5/20/2021# And #9/15/2021# Group by Vendor
arnel_gp
Jul 09, 2022Iron Contributor
your Criteria on Dsum() should be one expression:
DSum("AmountOrig","tblFXparent","Vendor = '" & [Vendor] & "' And DateSettle Between #5/20/2021# And #9/15/2021#") AS FCNotionals
or you can create a separated Aggregate query and join it with your first query:
select Vendor, Sum(AmountOrig) As FCNotionals From tblFXParent where DateSettle Between #5/20/2021# And #9/15/2021# Group by Vendor
DSum("AmountOrig","tblFXparent","Vendor = '" & [Vendor] & "' And DateSettle Between #5/20/2021# And #9/15/2021#") AS FCNotionals
or you can create a separated Aggregate query and join it with your first query:
select Vendor, Sum(AmountOrig) As FCNotionals From tblFXParent where DateSettle Between #5/20/2021# And #9/15/2021# Group by Vendor
Tony2021
Jul 09, 2022Iron Contributor
I see where I am wrong. thanks again for the expert help! Really appreciate it.