Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Convert Datatime to String error Post Reply Post New Topic
Author Message
quoc_duong_an
Newbie
Newbie


Joined: 25 Jul 2010
Online Status: Offline
Posts: 3
Quote quoc_duong_an Replybullet Topic: Convert Datatime to String error
     Posted: 25 Jul 2010 at 8:32pm
Hi all,

I've tried to convert Datetime value to string like that

if not IsNull({TABLE.DATETIME_COL}) then
    ToText({TABLE.DATETIME_COL},"MM/dd/yyyy")
else
    ""
It's OK for data which is not null, otherwise the report displays like this
12/31/-4714. Pls hepl me to display blank value.
Thanks

An Quoc




Edited by quoc_duong_an - 25 Jul 2010 at 8:34pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 26 Jul 2010 at 3:08am
I am guessing that this is a bad datetime, not a null value.  Try and figure out what it's value is and add it to the 'if' clause to filter it out.
 
HTH
IP IP Logged
quoc_duong_an
Newbie
Newbie


Joined: 25 Jul 2010
Online Status: Offline
Posts: 3
Quote quoc_duong_an Replybullet Posted: 28 Jul 2010 at 3:28pm
Hi HTH
I've checked the data and it was not null, actually. How can I explain my problem.
I have a master table and a detail table. The detail section contains detail table value which has datetime  col value.
And when displaying data, I want to suppress detail section if there is no data in it. So I set the suppress condition
like this Right ({@fNgayTT}, 2)='14' because the value of datetime always show '12/31/-4714'

Any helps?

Thanks

An Quoc

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 30 Jul 2010 at 3:21am
why not set it on the count of records detail section?...something like:
count({detailTable.field}, {grouping condition}) = 0
 
HTH
IP IP Logged
quoc_duong_an
Newbie
Newbie


Joined: 25 Jul 2010
Online Status: Offline
Posts: 3
Quote quoc_duong_an Replybullet Posted: 02 Aug 2010 at 3:11pm
Hi HTH
It worked well. Thanks
An Quoc

IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum