Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 17th, 2006, 05:17 PM
Registered User
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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})
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VS 2002 Crystal Report opens Seagate crystal 8 tusis_1 Crystal Reports 0 May 12th, 2007 11:45 AM
Syntax Error rsm42 ASP.NET 1.0 and 1.1 Basics 5 December 14th, 2006 02:01 PM
help syntax please khautinh SQL Server 2000 1 August 26th, 2006 02:47 AM
c# syntax msrnivas .NET Web Services 2 October 15th, 2004 01:26 AM
Incorrect syntax near '`' Hez Classic ASP Databases 3 August 5th, 2004 08:13 AM

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