Hi guys,
Need to do an UPDATE and REPLACE on a column in one of my tables.
The data concerned will be along the lines of this...
DE0012.00
DE0013.00
DE0017.00
DE0017.01
DE0017.02
DE0017.03
DE0017.04
DE0017.05
There are 2 things i need to do...
If the data ends in '.00' i need it to remove all of this
- so DE0012.00 would become DE0012
If the data doesn't end with '.00' but say '.001' i need to just remove the '.'
- so DE0017.01 would become DE001701
i know that the code below will remove all of the fullstops... but how can i get it to do both aspect of what i need to do?
cheers guys.
Need to do an UPDATE and REPLACE on a column in one of my tables.
The data concerned will be along the lines of this...
DE0012.00
DE0013.00
DE0017.00
DE0017.01
DE0017.02
DE0017.03
DE0017.04
DE0017.05
There are 2 things i need to do...
If the data ends in '.00' i need it to remove all of this
- so DE0012.00 would become DE0012
If the data doesn't end with '.00' but say '.001' i need to just remove the '.'
- so DE0017.01 would become DE001701
i know that the code below will remove all of the fullstops... but how can i get it to do both aspect of what i need to do?
Code:
update NM_CodesFromNMNew
set dealer_code = REPLACE(dealer_code, '.','')
where dealer_code like 'DE%'
cheers guys.