BostonMA
asked on
How to convert a text field to date in crystal reports
I have a field which is of type string and looks like: 20080115 (ie YYYY-mm-dd)
Is there an easier way to convert it to type date than the following formula?
Local StringVar DaypartTemp;
Local StringVar MonthpartTemp;
Local StringVar YearpartTemp;
Local NumberVar Daypart ;
Local NumberVar MonthPart;
Local NumberVar YearPart ;
DayParttemp := Right({V_My_Portfolio_1.Ma nager Date From}, 2);
MonthParttemp := Mid({V_My_Portfolio_1.Mana ger Date From}, 5,2);
YearParttemp := Left({V_My_Portfolio_1.Man ager Date From}, 4);
Daypart := ToNumber(DaypartTemp);
MonthPart := ToNumber(MonthpartTemp);
YearPart := ToNumber(YearpartTemp);
Date (YearPart,MonthPart,DayPar t )
Is there an easier way to convert it to type date than the following formula?
Local StringVar DaypartTemp;
Local StringVar MonthpartTemp;
Local StringVar YearpartTemp;
Local NumberVar Daypart ;
Local NumberVar MonthPart;
Local NumberVar YearPart ;
DayParttemp := Right({V_My_Portfolio_1.Ma
MonthParttemp := Mid({V_My_Portfolio_1.Mana
YearParttemp := Left({V_My_Portfolio_1.Man
Daypart := ToNumber(DaypartTemp);
MonthPart := ToNumber(MonthpartTemp);
YearPart := ToNumber(YearpartTemp);
Date (YearPart,MonthPart,DayPar
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
DATE(Left({V_My_Portfolio_
Mid({V_My_Portfolio_1.Mana