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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top