Skip to Content

Convert string to date - LastFullMonth

Our company's database design changed, so now I have to edit all of my Crystal reports since they changed the "Service Date" field from a date to a string.

The new Service_Date format is YYYY-MM-DD (string)

How can I change my current formula, so it will work now?

{vwTranJrnlChgs.Service_Date} in LastFullMonth

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 01, 2017 at 06:07 PM

    Hi Cheryl,

    You can first check to make sure it's a date using IsDate then use CDate to convert it to a date like:

    If IsDate ({vwTranJrnlChgs.Service_Date}) Then 
        CDate ({vwTranJrnlChgs.Service_Date}) In LastFullMonth 
    Else False; 

    Good luck,

    Brian

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 01, 2017 at 08:27 PM

    Perfect. Thanks!

    Add comment
    10|10000 characters needed characters exceeded