Hello all,
I need to update my table which has about 2000 records in it. I need to update a column depending on what Location is in the record.
Below is my table structure:
tblLoc
LocID
LineID
LCCode
LCDesc
LocType
AssetLocTypeID
tblLine
LineID
Line
tblALLBS
BS_ID
Asset_Num
LineID
Location
AssetLocType
**Location = has the same info as LCCode.
The criteria is that every Location that has ODD numbers as the last two digits should = S
every Location that has Even numbers as the last two digits should = T
And at the beginning of the LCCode if there is BD or DD = D
Examples of code:
D166
D165
D015
DD102
All codes are four digits long and one which are for D are 5 digits long. The column I need to fill in is the AssetLocType in the ALLBS table.
I would appreciate some adivce on how i should build this sql statement or does a function need to be used?
Thanks
SRP
Have an Awesome Day!
I need to update my table which has about 2000 records in it. I need to update a column depending on what Location is in the record.
Below is my table structure:
tblLoc
LocID
LineID
LCCode
LCDesc
LocType
AssetLocTypeID
tblLine
LineID
Line
tblALLBS
BS_ID
Asset_Num
LineID
Location
AssetLocType
**Location = has the same info as LCCode.
The criteria is that every Location that has ODD numbers as the last two digits should = S
every Location that has Even numbers as the last two digits should = T
And at the beginning of the LCCode if there is BD or DD = D
Examples of code:
D166
D165
D015
DD102
All codes are four digits long and one which are for D are 5 digits long. The column I need to fill in is the AssetLocType in the ALLBS table.
I would appreciate some adivce on how i should build this sql statement or does a function need to be used?
Thanks
SRP
Have an Awesome Day!