Show total results of calculated field

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)?
 
G

Guest

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
__________________________________________
 

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

Similar Threads

Access Dcount (multiple criteria) 3
Design and layout for Order Analysis? 5
Week number 1
Day Calculation in Report 6
Week numbers 2
DateDiff on blank fields? 4
Calculating a field based on other fields in a form... 1
Calculations 14

Top