cancel
Showing results for 
Search instead for 
Did you mean: 

Parse a value from text to Date

Former Member
0 Kudos

Hello everybody,

I have a little problem. I have a value in a store, that is a Date parsed to a string under this format : 'YYYY/MM/DD'

I need to display this string as default value in a date picker. So, I put default value of the date picker as "DVAL(STORE@date)" but it doesn't work.

For example, when the text in my store is "2009/06/04" the date picker display "November, 29 1909" and when I change the year, for example "2008/06/04", the date picker display "November, 30 1909"

Can somebody help me please to find the good parsing function ?

Thank you for advance.

Best regards,

Damien

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I solved my problem by using some of your tips. Thank you Martin

Best regards,

Damien

Edited by: Damien RUBIO on Jun 25, 2009 9:57 AM

Former Member
0 Kudos

Hi Damien,

Change the formatting for the date picker to "custom" and give this formula for the expression field

DSTR(@DATE1, "YYYY/MM/DD").

regards,

AE

Former Member
0 Kudos

thank you for your answer.

I tried what you told me, but it doesn't work. The problem doesn't come from the display of the date picker, but from its interpretation of my text value... Formatting options are just display options... Do you have another idea ?

Edited by: Damien RUBIO on Jun 5, 2009 1:47 PM

Former Member
0 Kudos

yes i had the same problem.

my string format was like: 19800405 --> YYYYMMDD.

what i had to do is format the text to 05.04.1980 --> DD.MM.YYYY.

I set the formula MID(@DateOfBirth,6,2)&"."&MID(@DateOfBirth,4,2)&"."&LEFT(@DateOfBirth,4) as the default value of the datasourcefield.

then i made a field in the datastore like DOB_CONV (Data Type: DATE) , then i mapped the datasourcefield @DateOf Birth to the DOB_CONV field with the formula: DVAL(@DateOfBirth).

now i set hte devault value of the datepicker to: STORE@DOB_CONV.

and now it works.

you must do this in the same way, regarding to your datestring format .

good luck