Joined: 03 Oct 2008
Online Status: Offline
Posts: 2
Topic: Formula - A number is required here Posted: 03 Oct 2008 at 7:50am
The is the formula that I have entered
{Entities_BCO.EntLookup} = "enco" and {InsPolicy.PolExpDate} > DateTime (2008, 09, 01, 0, 0, 0) and if{InsLine.LineAnnualizedPrem} >= '0' then Maximum ({InsCovTerm.CovTermVersion})
When I check the formula is brings up the error "A number is required here". It hightlights the '0' that I have entered in the if line. I've tried entering a number 1 also. What am I doing wrong?
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 03 Oct 2008 at 9:34am
On the third line, there shouldn't be an 'if' statement stuck in the middle of the formula. 'IF' can only go at the beginning of a line. I would move the 'IF' to the beginning of the first line and that should get you closer to the correct result.
I have the complete Crystal syntax documented in my Encyclopedia book and sample code listings. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 03 Oct 2008 at 10:22am
Well, you move the "then" to the middle of the statement now. Try this:
if {InsLine.LineAnnualizedPrem} >= 0 and {InsPolicy.PolExpDate} > DateTime (2008, 09, 01, 00, 00, 00) and {Entities_BCO.EntLookup} = "enco"
then Maximum({InsCovTerm.CovTermVersion}) else 0
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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