Skip to Content
0

Convert string to date - LastFullMonth

Nov 01, 2017 at 04:40 PM

26

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Brian Dong Nov 01, 2017 at 06:07 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Cheryl Warner Nov 01, 2017 at 08:27 PM
0

Perfect. Thanks!

Share
10 |10000 characters needed characters left characters exceeded