SQL Question

  • Thread starter Thread starter Moe
  • Start date Start date
M

Moe

Can anybody decipher what this is trying to say?

DECODE(SUBSTR(DISC_CD,1,3),NULL,'
','367','DNP','408','NIC','607','NIC',DECODE(FLOOR(ASCII(SUBSTR(DISC_CD,1,1))/60),0,'NIC','DNP')

Examples of the disc_cd are 36712, 60706, etc....

Thanks,
Mo
 
Moe said:
Can anybody decipher what this is trying to say?

DECODE(SUBSTR(DISC_CD,1,3),NULL,'
','367','DNP','408','NIC','607','NIC',DECODE(FLOOR(ASCII(SUBSTR(DISC_CD,1,1))/60),0,'NIC','DNP'))

Examples of the disc_cd are 36712, 60706, etc....

This is Oracle SQL syntax:

DECODE (CASE in standard SQL) = Switch in VBA.
SUBSTR = InStr in VBA.
ASCII = Asc in VBA.

HTH,
Jamie.

--
 
Back
Top