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.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top