Week and month total query

  • Thread starter Thread starter WylieC
  • Start date Start date
W

WylieC

I have a db that I use to track mileages. How do I make a
query that displays two different totals: the current
months totals to date and the weekly total to date
(weekly being Monday thru Sunday.)

Thank you.
 
SELECT Sum( Abs(Format(Date(),"yyyymm") = Format([datefield],"yyyymm") ) *
[Miles]) as MTDMileage,
Sum( Abs(Format(Date(),"yyyyww") = Format([datefield],"yyyyww") ) * [Miles])
as WTDMileage
 
Back
Top