troubleshooting Question

UpDate Field

Avatar of TonyEF
TonyEF asked on
Microsoft AccessMicrosoft SQL ServerMicrosoft SQL Server 2008
6 Comments1 Solution236 ViewsLast Modified:
I have a table named "InspectionsInfo" in this table there are two Fields:
"Inspection Number" and " Inspection Type Code"

I like to have a script that I can run to update the Inspection number is the following criteria is found:

If the "Inspection Number" and "Inspection Type Code" are the same  then update any subsquent records where these two fields are the same by adding an "A","B","C",etc, to the end of the "Inspection Number" see example below.

Can someone please assist me with this script???

                      CURRENT DATA                                       AFTER UPDATE
Inspection Number  Inspection Type Code              Inspection Number
1998-00000130               PL05                                     1998-00000130
1998-00000130               PL01                                             1998-00000130
1998-00000130               PL01                                            1998-00000130A
1998-00000130               PL04                                            1998-00000130
1998-00000130               PL04                                            1998-00000130A
1998-00000130               PL04                                            1998-00000130B
1998-00000130               PL04                                            1998-00000130C
1998-00000130               PL04                                            1998-00000130D
1998-00000130               BD03                                          1998-00000130
1998-00000130               BD03                                          1998-00000130A
Brian Crowe
Database Engineer
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros