Hello all,
I am looking for Ideas as to how to handle some data. I am new to VBA and sql(but love to learn and have not had any luck making queries do what I need them to do here. Can someone point me in a direction that would help.
The Problem : The data listed below is a single Locomotive unit number and the date and time that it was shopped and released from the shop as well as the Work codes that were completed. What I need is to take the Release time (B) and compair it to Shopped time (C). If they are within 24 hours i need to add the 2 shoppings together and concatenate the work codes as shown in example #2. I need this logic to contininue as long as there are units shopped within 24 hours of the last release date. This could range from 1 - 15 shoppings. Any suggestions or recommended study material to help me figure out how to do this in sql or vba would be greatly appretiated.
Example #1
Eqmt# ShoppedDate ReleasedDate Work Codes
6198 11/11/2007 9:50 PM(A) 11/12/2007 10:57 AM(B) US TF
6198 11/12/2007 10:58 AM(C) 11/15/2007 3:51 PM(D) PM PI
6198 11/15/2007 3:52 PM(E) 11/15/2007 4:56 PM(F) PM TF
6198 11/15/2007 4:57 PM(G) 11/17/2007 3:38 AM(H) PM EC MM
Example#2
UP6198 11/11/2007 9:50 PM(A) 11/15/2007 3:51 PM(D) US TF PM PI
I am looking for Ideas as to how to handle some data. I am new to VBA and sql(but love to learn and have not had any luck making queries do what I need them to do here. Can someone point me in a direction that would help.
The Problem : The data listed below is a single Locomotive unit number and the date and time that it was shopped and released from the shop as well as the Work codes that were completed. What I need is to take the Release time (B) and compair it to Shopped time (C). If they are within 24 hours i need to add the 2 shoppings together and concatenate the work codes as shown in example #2. I need this logic to contininue as long as there are units shopped within 24 hours of the last release date. This could range from 1 - 15 shoppings. Any suggestions or recommended study material to help me figure out how to do this in sql or vba would be greatly appretiated.
Example #1
Eqmt# ShoppedDate ReleasedDate Work Codes
6198 11/11/2007 9:50 PM(A) 11/12/2007 10:57 AM(B) US TF
6198 11/12/2007 10:58 AM(C) 11/15/2007 3:51 PM(D) PM PI
6198 11/15/2007 3:52 PM(E) 11/15/2007 4:56 PM(F) PM TF
6198 11/15/2007 4:57 PM(G) 11/17/2007 3:38 AM(H) PM EC MM
Example#2
UP6198 11/11/2007 9:50 PM(A) 11/15/2007 3:51 PM(D) US TF PM PI
Comment