Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 17th, 2006, 05:17 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
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})
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:26 PM.


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