Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Convert String to Date

Posted on 2008-09-30
2
Medium Priority
?
263 Views
Last Modified: 2008-09-30
How do I convert the following String to Date with a formula
String "050708"
Where 05 is the day, 07 is the month and 08 is the month
So I would get the output like
05-July-08
0
Comment
Question by:ranhell
  • 2
2 Comments
 
LVL 10

Author Comment

by:ranhell
ID: 22607666
Correction
How do I convert the following String to Date with a formula
String "050708"
Where 05 is the day, 07 is the month and 08 is the year
So I would get the output like
05-July-08
0
 
LVL 10

Accepted Solution

by:
ranhell earned 0 total points
ID: 22608795
I figure it out by myself

Local NumberVar ano;
Local NumberVar mes;
Local NumberVar dia;
if Length ({TEMPIN.CB}) = 30 then
(   dia := tonumber(left(right({TEMPIN.CB},27),2)) ;
    mes := tonumber (left(right({TEMPIN.CB},24),1));
    ano := tonumber (left(right({TEMPIN.CB},23),2))+ 2000;
    datevalue(ano,mes,dia);
)

Else
(   dia := tonumber(left(right({TEMPIN.CB},15),2)) ;
    mes := tonumber (left(right({TEMPIN.CB},12),1));
    ano := tonumber (left(right({TEMPIN.CB},11),2))+ 2000;
    datevalue(ano,mes,dia);
)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
How to increase the row limit in Jasper Server.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Loops Section Overview
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question