p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Crystal Reports (http://p2p.wrox.com/forumdisplay.php?f=113)
-   -   Crystal If Else Then syntax (http://p2p.wrox.com/showthread.php?t=49143)

MrPearl October 17th, 2006 05:17 PM

Crystal If Else Then syntax
 
I'm new to Crystal and am having an error, please help:

If ({ITEM.user_field_Contract_Start} < {?start date}) and ({ITEM.user_field_Contract_End} > {?end date}) then
datediff(d, {?start date}, {?end date})+1
else If ({ITEM.user_field_Contract_Start} >= {?start date}) and ({ITEM.user_field_Contract_End} <= {?end date}) then
datediff(d, {ITEM.user_field_Contract_Start}, {ITEM.user_field_Contract_End})
else if ({ITEM.user_field_Contract_Start} >= {?start date}) and (({ITEM.user_field_Contract_Start} <= {?end date}) and ({ITEM.user_field_Contract_End} > {?end date})) then
datediff(d, {ITEM.user_field_Contract_Start}, {?end date})
else
datediff(d, {?start date}, {ITEM.user_field_Contract_End})+1;

I hope that isn't to ugly to look at. A switch could work too I suppose.
My report has 2 parameters:
?start date
?end date

tia



All times are GMT -4. The time now is 03:29 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.