Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: DATE FORMULA PROBLEM Post Reply Post New Topic
Author Message
macke
Newbie
Newbie


Joined: 19 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 14
Quote macke Replybullet Topic: DATE FORMULA PROBLEM
     Posted: 19 Mar 2009 at 5:36am
Hi I have a date field in that I am linking to from a Sage Line 50 database:-

SOP_ITEM.DUE_DATE

if it is blank I need it to equal SALES_ORDER.DELIVERY DATE

if not I need it to display its value.

I have tried various if then else but keep getting syntax errors.

Help

macke
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 19 Mar 2009 at 6:28am
What sort of syntax errors, and could you give an example of what you have tried.  Is it blank or NULL?  Sorry, never dealt with that type of database, so I don't what is being returned.
 
Typically if it is a NULL value you would do something like:
IF ISNULL({SOP_ITEM.DUE_DATE}) THEN
  {SALES_ORDER.DELIVERY DATE}
ELSE
  {SOP_ITEM.DUE_DATE}
 
I am not sure how I would handle it being blank as Crystal would probably complain about a datetime value being needed.
 
You might try setting the null values to a default value of some sort, then you could check for that value in the formula instead of the null.  You can set this option at: File/Report Options/Set Null Values to default
 
Hope some of this helped
IP IP Logged
macke
Newbie
Newbie


Joined: 19 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 14
Quote macke Replybullet Posted: 19 Mar 2009 at 6:58am
You got it in one thank you. syntax error was caused by me having no brackets around SOP_ITEM.DUE_DATE.

Thank you
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 19 Mar 2009 at 7:52am
I always select from the window above in the formula editor...it will insert the darn brackets for me, and make sure that everything is the 'way' that Crystal likes it.
 
Glad I could help
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