P
Pat
I have an Access 2000 database and I would like to work out how many days a
'case' is open for. This can either mean a calculation between 2 dates -
i.e. a new case date and then a closed date (which I can do)- but it may
also mean that a case can be open and closed several times - and I just want
to add up the 'open' periods.
As a start off, I have joined the 2 tables in question Case and
CaseDateStatus and have the SQL as shown below
SELECT Case.CaseID, CaseDateStatus.CDate, CaseDateStatus.Type
FROM [Case] INNER JOIN CaseDateStatus ON Case.CaseID = CaseDateStatus.CaseID
WHERE (((Case.currentcasestatus)=3));
The WHERE clause is just selecting those cases that are currently closed,
as I only want to calculate against those. Not sure if this is the correct
start point though.
When a case is open or live - the Type in in CaseDateStatus is either a 1, 4
or 5 - if it's closed it's a 3. This means we start off with an 'open'
Type, then the case is 'closed' then it's open again and so on. I assume I
need to start from the Max Cdate against the case (which will always be
closed) and work backwards? I want this type of calculation done against
each Case and the result to be a number of days; I can then average them
etc. Just not sure about the way to write this with more than 2 dates
involved.
Any help would be much appreciated.
TIA
Pat
'case' is open for. This can either mean a calculation between 2 dates -
i.e. a new case date and then a closed date (which I can do)- but it may
also mean that a case can be open and closed several times - and I just want
to add up the 'open' periods.
As a start off, I have joined the 2 tables in question Case and
CaseDateStatus and have the SQL as shown below
SELECT Case.CaseID, CaseDateStatus.CDate, CaseDateStatus.Type
FROM [Case] INNER JOIN CaseDateStatus ON Case.CaseID = CaseDateStatus.CaseID
WHERE (((Case.currentcasestatus)=3));
The WHERE clause is just selecting those cases that are currently closed,
as I only want to calculate against those. Not sure if this is the correct
start point though.
When a case is open or live - the Type in in CaseDateStatus is either a 1, 4
or 5 - if it's closed it's a 3. This means we start off with an 'open'
Type, then the case is 'closed' then it's open again and so on. I assume I
need to start from the Max Cdate against the case (which will always be
closed) and work backwards? I want this type of calculation done against
each Case and the result to be a number of days; I can then average them
etc. Just not sure about the way to write this with more than 2 dates
involved.
Any help would be much appreciated.
TIA
Pat