Hi, I am a simple SQL view builder.....so please go easy on me. I have a table, that I wish to split one of the fields into 2 different fields, based on the length of data in the field.
Here is my view:
SELECT ACCTID, FISCALYR, FISCALPERD, TRANSAMT
Where Acctid needs to be split into 2.
the results of this query look like:
ACCTID FISCALYR FISCAL PERIOD TRANSAMT
1000 2014 01 19845.000
1000 2014 01 -1400.000
1000 2014 12 1400.000
10001020 2014 01 300.000
10001020 2014 12 -300.000
In the case above, I would like to create a new accountID, that would just be the first 4 digits
A second field would store the last 4 digits, so in the first 3 records, it would be null or zero
and in the last 2 examples it would be '1020'
Appreciate any assistance....again go easy on me. I just want to edit my view.