Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Round, Truncate etc not working Post Reply Post New Topic
Author Message
jcrow
Newbie
Newbie


Joined: 14 Aug 2014
Location: Australia
Online Status: Offline
Posts: 7
Quote jcrow Replybullet Topic: Round, Truncate etc not working
     Posted: 02 Dec 2014 at 6:21pm
Hi,

I have Crystal Reports 12.7.1.2131 on Windows 7.

I have the following formula as a field on my report:
-----------------------------------------------------------
if ({Command.due_dte} < currentdate) AND (isnull({Command.rcp_num})) then
    "OVERDUE " & truncate(currentdate - {Command.due_dte}) & " day(s)"
else if ({Command.due_dte} = currentdate) AND (isnull({Command.rcp_num})) then
    "DUE TODAY"
-----------------------------------------------------------

The issue I have is with this function:
truncate(currentdate - {Command.due_dte})

Say the answer is 12, it will return 12.00.  I initially tried the round function before the truncate function but they all return a value with 2 decimal places.

Does someone know why this may be the case?

thanks

jc
IP IP Logged
jcrow
Newbie
Newbie


Joined: 14 Aug 2014
Location: Australia
Online Status: Offline
Posts: 7
Quote jcrow Replybullet Posted: 02 Dec 2014 at 6:51pm
Ah, the function totext(currentdate - {Command.due_dte},0) did what I needed.
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