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 manipulation

Former Member
0 Likes
506

i have in a string 1/11/2007

i am doing this manipulation

V_year = <fs_upfile>-value+5.

v_month = <fs_upfile>-value+2(2).

v_day = <fs_upfile>-value(1)

and putting it in a field bwdat

but i don't know in advance if string will contain 11/11/2007 or 1/11/2007

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
484

Hi,

You can use split option and put all the resultant values into 3 variables containg day month year.

SPLIT <field> AT '/' INTO v_day v_month_v_year.

Otherwise if you want to follow your way only means you can do by calculating string length by strlen(field)

if it is 9 means you use ur way.

If the length is 10 means you change

V_year = <fs_upfile>-value+6(4).

v_month = <fs_upfile>-value+3(2).

v_day = <fs_upfile>-value+0(2)

Please reward points if its useful.

Thanks

Sivaparvathi

3 REPLIES 3
Read only

Former Member
0 Likes
484

Try

SPLIT <fs_upfile>-value AT '/' INTO v_day v_month_v_year.

Regards,

Nick

Read only

Former Member
0 Likes
484

try like this..


V_year = <fs_upfile>-value+5(4).
v_month = <fs_upfile>-value+2(2).
v_day = <fs_upfile>-value+0(1).
CONCATENATE v_year v_month v_day INTO bwdat.
"I'm not sure because date always can't be 1/11/2007
"some tiems may be 21/11/2007
"this case you've to use 
"v_day = <fs_upfile>-value+0(2).


Message was edited by:

Perez C

Read only

Former Member
0 Likes
485

Hi,

You can use split option and put all the resultant values into 3 variables containg day month year.

SPLIT <field> AT '/' INTO v_day v_month_v_year.

Otherwise if you want to follow your way only means you can do by calculating string length by strlen(field)

if it is 9 means you use ur way.

If the length is 10 means you change

V_year = <fs_upfile>-value+6(4).

v_month = <fs_upfile>-value+3(2).

v_day = <fs_upfile>-value+0(2)

Please reward points if its useful.

Thanks

Sivaparvathi