Thursday, December 17, 2015

SQL example of how to modify datavalue and add a leading zero.

First view the record your seeking to change. In this case I am looking for number store with 6 digits.

Select * from Coursework_Validation
where len(Outside_Institution_ID) = 6

Since the leading zero was chopped off on import (my mistake)...I am adding it back.

Update Coursework_Validation set Outside_Institution_ID = '0' + Outside_Institution_ID
where len(Outside_Institution_ID) = 6

No comments:

Post a Comment