Hi All,
I want to remove the leading "." i.e dot in the decimal value.
Example: Input is date(10) = 2005-05-18 after coverting the date to decimal
Output is Decimal(8) = 20050518.
My requirement is to get Decimal(8) = 20050518 i.e I want to skip the . (dot) value.
I tried using trim function and even tried reading the output in Char and Varchar data type but didn't work out.
Can anyone please help me out on how to achieve this in Enterprise Edition.
Many Thanks,
Spendem
Remove leading dot in the decimal value of fixed length
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The dot may not actually be there. It may be an artifact of the data browser. Does the dot get through to your target? If so, convert its data type to int64 or uint64 and the dot will vanish.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Remove leading dot in the decimal value of fixed length
Hi
i hope the following line helps you to get your required output
Ereplace("2005-05-18 ","-","")
Thanks
-Mspanda
i hope the following line helps you to get your required output
Ereplace("2005-05-18 ","-","")
Thanks
-Mspanda
spendem wrote:Hi All,
I want to remove the leading "." i.e dot in the decimal value.
Example: Input is date(10) = 2005-05-18 after coverting the date to decimal
Output is Decimal(8) = 20050518.
My requirement is to get Decimal(8) = 20050518 i.e I want to skip the . (dot) value.
I tried using trim function and even tried reading the output in Char and Varchar data type but didn't work out.
Can anyone please help me out on how to achieve this in Enterprise Edition.
Many Thanks,
Spendem
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Leading zeroes are not relevant for integer data types. Your original question made no mention of any need to preserve leading zeroes. You can add leading zeroes later, but I can not think of any way to preserve non-significant leading zeroes AND losing the dot.spendem wrote:If I m using BigInt or Integer(64) The preecing zeros seems to dissapear for Numeric field.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.