N
Nick
Hello,
I have a Transaction history table that records transactions and the
information that goes along with them line by line. The records I have are as
follows
ID (Primary Key)
BEGDATTIM
ENDSTATCD
ENDQUEUE
ENDWORKTYPE
ENDDATTIM
Some sample data would go like this:
ID BEGDATTIM ENDSTATCD ENDQUEUE ENDWORKTYPE ENDDATTIM
1 8:00AM SCANNED START APP
8:15 AM
1 8:30 AM ISSUED NEXT APP
8:45 AM
1 8:50 AM PASSED FINAL APPCWA
9:00 AM
What I'm trying to do is write a query that will add 3 additional fields to
this table: BEGSTATCD, BEGQUEUE, and BEGWORKTYPE. These fields are to contain
whatever the ENDSTATCD, ENDQUEUE, and ENDWORKTYPE fields contained in the
transaction that occured previous to it (time wise).
For example I would like to return as the result of my query (Say just for
STATCD):
ID BEGDATTIM ENDSTATCD BEGSTATCD
1 8:00 AM SCANNED SCANNED
1 8:30 AM ISSUED SCANNED
1 8:50 AM PASSED ISSUED
For the first record, as you can see I would like the BEGSTATCD = ENDSTATCD.
The same applies to WORKTYPE and QUEUE.
Anyone have any ideas on how I can do this??? I KNOW this can be done but I
am completely stumped.....Thank you so much!!!
Nick
I have a Transaction history table that records transactions and the
information that goes along with them line by line. The records I have are as
follows
ID (Primary Key)
BEGDATTIM
ENDSTATCD
ENDQUEUE
ENDWORKTYPE
ENDDATTIM
Some sample data would go like this:
ID BEGDATTIM ENDSTATCD ENDQUEUE ENDWORKTYPE ENDDATTIM
1 8:00AM SCANNED START APP
8:15 AM
1 8:30 AM ISSUED NEXT APP
8:45 AM
1 8:50 AM PASSED FINAL APPCWA
9:00 AM
What I'm trying to do is write a query that will add 3 additional fields to
this table: BEGSTATCD, BEGQUEUE, and BEGWORKTYPE. These fields are to contain
whatever the ENDSTATCD, ENDQUEUE, and ENDWORKTYPE fields contained in the
transaction that occured previous to it (time wise).
For example I would like to return as the result of my query (Say just for
STATCD):
ID BEGDATTIM ENDSTATCD BEGSTATCD
1 8:00 AM SCANNED SCANNED
1 8:30 AM ISSUED SCANNED
1 8:50 AM PASSED ISSUED
For the first record, as you can see I would like the BEGSTATCD = ENDSTATCD.
The same applies to WORKTYPE and QUEUE.
Anyone have any ideas on how I can do this??? I KNOW this can be done but I
am completely stumped.....Thank you so much!!!
Nick