Week and month total query

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.
 
D

Duane Hookom

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