Quantcast
Viewing all articles
Browse latest Browse all 9052

Re: Time Date field in Excel seen as string in Crystal Reports

Hi,

 

Antonio's formula almost works but in your case two things need to change: you need to see if the value is empty or not and you need to convert to DateTime, not just tdate.

 

Try this:

 

if length ({Times_.TimeIn}) > 10 then

    cDateTime (left (mydt,instrrev ({Times_.TimeIn},":")-1))

Else DateTime (0, 0, 0, 0, 0, 0);

 

I used the length to see if the field is empty or not.  You can check for other things like a ":" or something else.

 

If there is a value then it converts the field to a date time. Otherwise it passes a null date time.

 

Brian


Viewing all articles
Browse latest Browse all 9052

Trending Articles