count on days with open and closed status

G

Guest

I have a database in which I need to create a query that will give me the
count on days from the day they were opened until they have a status of
closed if they are not closed then I need a count on days for how long they
are open up until todays date. I am not sure if I can do this all in one
column. Any help would be great.
 
J

John Spencer

IT depends on your table structure. For instance, if you have two fields
DateOpen and DateClosed, then

FIELD: DaysOpen: DateDiff("d",DateOpen, NZ(DateClosed,Date()))

If the dates and status are in multiple records then it can still be done.
It is just a little more complex to get the relevant data before using
DateDiff to calculate the number of days.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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

Top