Joined: 13 May 2010
Online Status: Offline
Posts: 3
Topic: Crystal Code help Posted: 13 May 2010 at 1:20am
Hello,
Hoping someone can help with this please...
Basically,
I'm fairly new to Crystal Reports and seeking help with the correct
code/syntax to state the following on one of my existing Crystal
reports...
Currently I have this paragraph in one of my reports:
If
{Property.Current_Asking_Price}*({Property.Sole_Terms}/100) =<1600
then (£1600 plus VAT) else
{Property.Current_Asking_Price}*({Property.Sole_Terms}/100)
I
know this syntax isn't correct but wondered if someone can please
assist?
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 13 May 2010 at 3:40am
it would seem that you just need to replace (£1600 plus VAT) with its value... 1600 * (however the tax is figured), and if it constant, say 10% for example, then just print that number...1760
Joined: 13 May 2010
Online Status: Offline
Posts: 3
Posted: 15 Jun 2010 at 3:53am
Thanks for that... the figure won't remain constant, so I would like to keep the '(£1600 plus VAT)' text in the code. However, I am still getting the following error:
"a string is required here"
This appears after the 'else' word. Any ideas welcome please.
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 15 Jun 2010 at 4:29am
You will need to do a totext on the else part of the if.
If {Property.Current_Asking_Price}*({Property.Sole_Terms}/100) =<1600 then (£1600 plus VAT) else totext({Property.Current_Asking_Price}*({Property.Sole_Terms}/100))
The totext also will let you set the number of decimal points needed (defaults to two).
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 16 Jun 2010 at 3:59am
I agree...both sides of the if then / else side must return the same type of item...since the if side is returning a string, the else side must as well.
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