Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Date Problem

Former Member
0 Kudos
84

Hi Experts,

I have Date Field in char(10) format..i.e 2007-06-03.

Now i want to remove this extra '-' or '.'. How to do this.( i need this: 20070603)

Thanks in advance.

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos
64

replace all occurances of '-' in date with ''.

or

translate date using '- '.

condense date no-gaps.

Regards,

Ravi

5 REPLIES 5

p291102
Active Contributor
0 Kudos
64

HI,

Use the FM CONVERT_DATE_TO_INTERNAL

It will helps u.

Thanks,

Shankar

Former Member
0 Kudos
64

translate w_char using '- '.

condense w_char no-gaps.

after - in single quotes space is necessary...

reward helpful answers..

sai ramesh

former_member181962
Active Contributor
0 Kudos
65

replace all occurances of '-' in date with ''.

or

translate date using '- '.

condense date no-gaps.

Regards,

Ravi

Former Member
0 Kudos
64

try this


data : cdate(10) type c value '2007-06-03',
       ndate(10) type n.

       ndate = cdate.

shift ndate left deleting leading '0'.
cdate = ndate.

it will only take numeric value dont bother about separator whether it is '.' or '-'.

regards

shiba dutta

Former Member
0 Kudos
64

hi

good

store each value into a string and at the end use CONCATENATE statement to join all the values except '-' and display that.

Thanks

mrutyun^