tags:

views:

14

answers:

1

![alt text][1]Hi, please give me the SQL code to copy and paste. I need to get the desired output, per the photo link http://i566.photobucket.com/albums/ss105/nrfollowup1/delete.jpg

I need to remove all characters after and including the dash

SELECT SYSADM_PURC_ORDER_LINE.PURC_ORDER_ID FROM SYSADM_PURC_ORDER_LINE;

A: 
SELECT IIF(INSTR(s.PURC_ORDER_ID,'-'),MID(s.PURC_ORDER_ID, 1, INSTR(s.PURC_ORDER_ID,'-')-1), s.PURC_ORDER_ID) as DesiredOutput
FROM SYSADM_PURC_ORDER_LINE.PURC_ORDER_ID s;
Tahbaza