Application Development and Automation 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: 
Read only

Date Problem

Former Member
0 Likes
553

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
Read only

Former Member
0 Likes
533

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

or

translate date using '- '.

condense date no-gaps.

Regards,

Ravi

5 REPLIES 5
Read only

p291102
Active Contributor
0 Likes
533

HI,

Use the FM CONVERT_DATE_TO_INTERNAL

It will helps u.

Thanks,

Shankar

Read only

Former Member
0 Likes
533

translate w_char using '- '.

condense w_char no-gaps.

after - in single quotes space is necessary...

reward helpful answers..

sai ramesh

Read only

Former Member
0 Likes
534

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

or

translate date using '- '.

condense date no-gaps.

Regards,

Ravi

Read only

Former Member
0 Likes
533

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

Read only

Former Member
0 Likes
533

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^