CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2014

    Need help converting a string field to date in crystal report


    I have a field in my form called {Hosp_Charges_.from_routine} this field is in string and its a date and this filed outputs date like 20110404 I like to turn this field to a date filed like 04/04/2011. can you help please.

  2. #2
    Join Date
    Jul 2005

    Re: Need help converting a string field to date in crystal report

    You could use a formula field and write code that:
    0 Declare variables
    1 Extract the month day & year part of the string, using the MID function
    2 Convert to numeric value each one using the TONUMBER function
    3 Use the DATE or DATEVALUE or DATESERIAL functions to convert those extracted parts to a date field
    4 Place the formula field in the desired section
    5 Format as you format a date field
    Last edited by jggtz; March 7th, 2014 at 03:53 PM.

    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.