Show total results of calculated field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field which calculates number of weeks from one specified date to
another specified date. How would I create a calculated field that counts
the number of records having say, a result of 8 weeks or less (<=8)?
 
Hi Wayne,

Try the following SQL statement in the Northwind sample database:

SELECT Orders.OrderDate, Orders.ShippedDate,
-1*(DateDiff("ww",[OrderDate],[ShippedDate])<=8) AS [Delivery Target Met]
FROM Orders;

This will return a 1 for each record that meets the condition. You could
base another query on this query to sum the result of the [Delivery Target
Met] column. Or, you could do this summing directly in a report that was
based in part of this query.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Back
Top