Solved

Convert String to Date

Posted on 2008-09-30
2
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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