Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table #test (NoFaktur varchar(20))
- insert into #test Values ('999/DODOL/X/2016');
- insert into #test Values ('9/DODOL/X/2016');
- insert into #test Values ('1099/DODOL/X/2016');
- insert into #test Values ('892/DODOL/X/2016');
- insert into #test Values ('1096/DODOL/X/2016');
- insert into #test Values ('839/DODOL/X/2016');
- insert into #test Values ('59/DODOL/X/2016');
- insert into #test Values ('12/DODOL/X/2016');
- insert into #test Values ('3/DODOL/X/2016');
- SELECT NoFaktur
- , REPLACE (STR (CAST (Substring (NoFaktur, 1, CHARINDEX ('/', NoFaktur, 1)-1) AS INT), 4), SPACE(1), '0') as cNoFaktur
- from #test
- order by cNoFaktur
- Drop table #test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement