Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Calculate the length in days of a status in a history file

Status
Not open for further replies.

sccses

Technical User
Aug 26, 2003
7
US
I am using Access 2003 and have a query or report problem. The file is a 4 field history file for project issues with a record created when the Status changes. The fields are PrimKey, IssueID, Status, DateTime. I need to query to calculate how many days the Issue was in a certain state. So basically take the Date Time of one entry and calculate the number of days between the next entry for that Issue number. I am trying to do this in Access and not use VB (not a vb programmer) but I could if thats the only way.
 
Something like this ?
SELECT A.IssueID, A.Status, A.DateTime, B.Status, B.DateTime, (B.DateTime - A.DateTime) AS CountOfDays
FROM yourTable A INNER JOIN yourTable B
ON A.IssueID = B.IssueID AND A.DateTime < B.DateTime

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top