Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Creating a Formula Post Reply Post New Topic
Author Message
jemory
Newbie
Newbie


Joined: 10 Jun 2011
Location: United States
Online Status: Offline
Posts: 1
Quote jemory Replybullet Topic: Creating a Formula
    Posted: 10 Jun 2011 at 9:29am

I would like to create a formula that shows the time portion of a date/time field or if empty “none”.  I have created two formulas

 

Formula 1- Named:  @orginal value

·         TimeValue ({vAuditPunchRpt.OriginalValue})

·         This works fine

 

Formula 2: 

·         If {@Orginal Value}= Time (0,0,0)then "None" else {@Orginal Value}

·         Partially works if I don’t have the “else {@Orginal Value}”

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Jun 2011 at 4:17am

if isnull({vAuditPunchRpt.OriginalValue}) or or time({vAuditPunchRpt.OriginalValue}) = time(0,0,0) then 'none' else totext({vAuditPunchRpt.OriginalValue},"h:mm tt")

IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.