How to convert Decimal to Date using IsValid() function?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sureshe005
Participant
Posts: 4
Joined: Wed Jan 19, 2011 1:00 pm
Location: Hyderabad

How to convert Decimal to Date using IsValid() function?

Post by sureshe005 »

How to convert Decimal to Date using IsValid() function.
Ex. 99991231 to 9999-12-31
Thanks in Advance
Suresh
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Re: How to convert Decimal to Date using IsValid() function?

Post by jwiles »

isvalid() requires a string value, so:

Convert the decimal to a string
Use isvalid() to test the validity of the string
if valid then convert string to date

If the decimal is nullable be certain to handle nulls first in your logic.

IS 8.5 has expanded the functionality of isvalid() and has added type-specific functions such as isvaliddate().

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply