Solved

Convert String to Date

Posted on 2008-09-30
2
253 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
How to increase the row limit in Jasper Server.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now