Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date ToText issue Post Reply Post New Topic
Author Message
swatts
Groupie
Groupie
Avatar

Joined: 17 Mar 2010
Online Status: Offline
Posts: 83
Quote swatts Replybullet Topic: Date ToText issue
     Posted: 16 Mar 2011 at 4:47am
I am bringing in a date field to my report and when if I format the field I can make it a mm/dd/yyyy which is what we need for state reporting. However, there is a chance that the field will be empty, so I have to write a couple of formulas, one is ToText and then the next one is if isnull (datefield). However, the problem here is, it cuts off any zeros....ie, if the date field is 01/03/2011, it shows up 1/3/2011. Is there any other way to get this right? I have to do the ToText so I can do the if isnull (datefield) then "          " (10 spaces for a filler).
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Mar 2011 at 5:11am
if isnull(datefield) then '          ' else totext(datefield,'MM/dd/yyyy')
IP IP Logged
swatts
Groupie
Groupie
Avatar

Joined: 17 Mar 2010
Online Status: Offline
Posts: 83
Quote swatts Replybullet Posted: 16 Mar 2011 at 5:18am
God bless you! This worked!!!! Awesome! Thank you!
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