Wrox Programmer Forums
|
BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7
This is the forum to discuss the Wrox book Professional SQL ServerReporting Services by Paul Turley, Todd Bryant, James Counihan, George McKee, Dave DuVarney; ISBN: 9780764568787
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 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 June 8th, 2004, 03:43 PM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4 Conditional Expressions Problem

I have followed the instructions on page 150 for using the conditional expressions for the Color property of the Quantity textbox in the detail row of the table. I typed in the expression as shown. Here it is:

=IF( Fields!Quantity.Value < Fields!ReorderPoint.Value, "Red", "Black" )

I keep generating the following compilation error:

The color expression for the textbox ‘Quantity’ contains an error: [BC30201] Expression expected.
Preview complete -- 1 errors, 0 warnings

Any suggestions?
 
Old June 9th, 2004, 02:18 PM
Wrox Author
 
Join Date: May 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to use the IIF function rather than IF.

Paul Turley, MCSD, MCDBA, MCT, MSF Practitioner
 
Old June 30th, 2004, 03:07 AM
Registered User
 
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm almost getting the same error message:

The expression for the query ‘bus’ contains an error: [BC30201] Expression expected.

I'm trying to do a dynamic query in reporting services. The static query works perfectly, but the one below does not. The only change I've made is the highlighted IIF statement.

="SELECT Bus.RNID AS r1, Bus.RNID AS r2, Bus.Name, ESStatus.CreationTime, CAST(ESStatus.CreationTime AS char(12)) AS date, ESStatus.ErrorText
FROM Bus INNER JOIN
      ESStatus ON Bus.Id = ESStatus.UnitId
WHERE (ESStatus.CreationTime BETWEEN @startDate AND @EndDate) AND (Bus.RNID = @RNID)
GROUP BY ESStatus.CreationTime, Bus.Name, Bus.RNID, Bus.Id, ESStatus.ErrorText" & IIF(Parameters!ErrorText.Value = 'All', "", " HAVING (ESStatus.ErrorText = N'gps reciever status: failure')") & ""

just for reference I put in the working static code below.

SELECT Bus.RNID, ESStatus.CreationTime, bus.name, CAST(ESStatus.CreationTime AS char(12)) AS date, ESStatus.ErrorText
FROM Bus INNER JOIN
      ESStatus ON Bus.Id = ESStatus.UnitId
WHERE (ESStatus.CreationTime BETWEEN @startDate AND @EndDate) AND (Bus.RNID = @RNID)
GROUP BY ESStatus.CreationTime, Bus.Name, Bus.RNID, Bus.Id, ESStatus.ErrorText
HAVING (ESStatus.ErrorText = N'GPS reciever status: failure')
I would really appreciate some help, resolving this problem!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Regular Expressions WestRowOps Other Programming Languages 1 May 18th, 2007 05:34 AM
Conditional Select problem rodmcleay SQL Server 2000 3 September 7th, 2005 07:42 PM
grouping and expressions problem parityah BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 May 2nd, 2005 06:43 PM
Conditional Expressions jquinn BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 October 4th, 2004 09:36 AM
Regular Expressions Dave Doknjas C# 1 August 9th, 2003 12:05 AM





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