dfwcharles
Technical User
Cyrstal v8, MS Sql 2000 db.
I'm trying to get the age, in days, of Workorder statuses. The statuses are stored in one table(wostatus) with a change date. Here's an example:
wonum status changedate
---------------------------------
2932 WAPPR 2005-05-01 08:55:00.000
2932 APPR 2005-05-03 09:55:00.000
2932 COMP 2005-05-04 08:21:00.000
2932 CLOSE 2005-05-04 08:22:00.000
What I want to get is the age between rows 1 & 2, 2 & 3, and 3 & 4. The age of the last row is irrelevent to the report. The report will also be grouped on wonum.
I can accomplished this in SQL with a stored procedure, but I would rather do everything in Crystal.
I was thinking that I could declare variables for each changedate and then use the datediff function to get the age. But I'm not sure how to write in crystal, something like this: Local dateVar d1 : = {wostatus.changedate}; where status = 'wappr'.
Anyhelp would be appreciated.
I'm trying to get the age, in days, of Workorder statuses. The statuses are stored in one table(wostatus) with a change date. Here's an example:
wonum status changedate
---------------------------------
2932 WAPPR 2005-05-01 08:55:00.000
2932 APPR 2005-05-03 09:55:00.000
2932 COMP 2005-05-04 08:21:00.000
2932 CLOSE 2005-05-04 08:22:00.000
What I want to get is the age between rows 1 & 2, 2 & 3, and 3 & 4. The age of the last row is irrelevent to the report. The report will also be grouped on wonum.
I can accomplished this in SQL with a stored procedure, but I would rather do everything in Crystal.
I was thinking that I could declare variables for each changedate and then use the datediff function to get the age. But I'm not sure how to write in crystal, something like this: Local dateVar d1 : = {wostatus.changedate}; where status = 'wappr'.
Anyhelp would be appreciated.