鉴于下表,我目前正在根据存储在表格中的上次操作日期处理老化报告:
RequestNo UserCode LastActionDate ActionType
REQ1 407 12/14/2012 9:47 Saved
REQ1 407 12/14/2012 9:48 Submitted
REQ1 407 12/14/2012 9:48 Approved
REQ1 203 12/17/2012 9:54 Reviewed
REQ1 242 12/18/2012 10:29 WF Setup in Dev.
REQ1 203 12/18/2012 15:14 Transport to prod.
REQ1 242 12/18/2012 15:16 Completed
REQ2 407 12/27/2012 10:36 Submitted
REQ2 456 12/27/2012 11:18 Approved
REQ2 407 12/27/2012 11:27 Approved
REQ2 203 12/27/2012 17:34 Reviewed
REQ2 242 12/28/2012 14:07 WF Setup in Dev.
REQ2 203 12/28/2012 14:11 Transport to prod.
REQ2 242 12/28/2012 21:27 Completed
REQ3 407 12/27/2012 11:32 Submitted
REQ3 456 12/27/2012 11:33 Approved
REQ3 407 12/27/2012 11:34 Approved
REQ3 203 12/27/2012 17:33 Reviewed
REQ3 242 12/27/2012 18:33 WF Setup in Dev.
REQ3 203 12/28/2012 13:43 Transport to prod.
REQ3 242 1/3/2013 14:56 Completed
我需要生成一个包含以下列RequestNo、UserCode、ReceivedDate、LastActionDate、ActionType、Aging(LastActionDate和ReceivedDate之差)累积的老化表。就像下表
RequestNo UserCode ReceivedDate LastActionDate ActionType Aging Cummulative
REQ1 407 12/14/2012 9:47 12/14/2012 9:47 Saved 0 0
REQ1 407 12/14/2012 9:47 12/14/2012 9:48 Submitted 0 0
REQ1 407 12/14/2012 9:48 12/14/2012 9:48 Approved 0 0
REQ1 203 12/14/2012 9:48 12/17/2012 9:54 Reviewed 3 3
REQ1 242 12/17/2012 9:54 12/18/2012 10:29 WF Setup in Dev. 1 4
REQ1 203 12/18/2012 10:29 12/18/2012 15:14 Transport to prod. 0 4
REQ1 242 12/18/2012 15:14 12/18/2012 15:16 Completed 0 4
REQ2 407 12/27/2012 10:36 12/27/2012 10:36 Submitted 0 0
REQ2 456 12/27/2012 10:36 12/27/2012 11:18 Approved 0 0
REQ2 407 12/27/2012 11:18 12/27/2012 11:27 Approved 0 0
REQ2 203 12/27/2012 11:27 12/27/2012 17:34 Reviewed 0 0
REQ2 242 12/27/2012 17:34 12/28/2012 14:07 WF Setup in Dev. 1 1
REQ2 203 12/28/2012 14:07 12/28/2012 14:11 Transport to prod. 0 1
REQ2 242 12/28/2012 14:11 12/28/2012 21:27 Completed 0 1
REQ3 407 12/27/2012 11:32 12/27/2012 11:32 Submitted 0 0
REQ3 456 12/27/2012 11:32 12/27/2012 11:33 Approved 0 0
REQ3 407 12/27/2012 11:33 12/27/2012 11:34 Approved 0 0
REQ3 203 12/27/2012 11:34 12/27/2012 17:33 Reviewed 0 0
REQ3 242 12/27/2012 17:33 12/27/2012 18:33 WF Setup in Dev. 0 0
REQ3 203 12/27/2012 18:33 12/28/2012 13:43 Transport to prod. 1 1
REQ3 242 12/28/2012 13:43 1/3/2013 14:56 Completed 6 7