473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sum(IIF(<expr.)) Problem in ADP Report Control

I am currently in the process of converting an MDB to ADP linked to a
SQL Server back end. In the MDB I have expressions in both queries
and report controls that are essentially:

Sum(IIF(<expr>,1,0))

These give me counts for certain parameters.

In the queries I was able to create views were I replaced these with
CASE ... WHEN statements with a sum in the Group By clause.

However I can not find a way to replicate this functionality in a
report control, the Control Source will not even accept a CASE ...WHEN
statement and with IIF I receive the following error:

The expression 'Sum(IIf(<expr>,1,0)) is invalid

Any help you can offer would be greatly appreciated.

Jun 19 '07 #1
1 2759
Hi Dave,

Try creating your query in a stored procedure. Test out your SP in
query analyzer. If the SP works in QA, then set the Report recordsource
to the Stored Procedure. Note: If you have to pass a parameter to the
SP, you have to open the Report in Design View, set the params as
follows:

DoCmd.OpenReport reportName, acViewDesign

Reports("YourReport).inputParameters = "@UserId='" & strUserID & "',
@BeginDate='" & strBegingDate & "', @EndDate='" & strEndDate & "'"

DoCmd.Close acReport, reportName, acSaveYes
DoCmd.OpenReport reportName, acViewPreview

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jun 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lore Leuneog | last post by:
Hello Which command do I've to use to set the focus on a control placed on a report in Design-View. Ctrl.SetFocus and Cmd.GoToControl don't work for a report. The aim is to copy the control...
1
by: Tom Louchbaum | last post by:
Can someonw pls tell me how to reference the Where clause made by the VBA statement DoCmd.OPENREPORT "Report",acviewpreview,,where as a control within the Report itself? Thanks.
1
by: meyvn77 | last post by:
I have a project using crash data where I would like a form to promp the user for 1 of the 8 stock report from a pulldown box with options A through E and a 'From' date and 'To' date. The options...
2
by: Ian Hinson | last post by:
Hi, In an MDB report I was able to obtain an Orders total in a Group Footer by setting a control's ControlSource to: =Sum(*) In the Detail section of the report are controls bound to: (1)...
2
by: Julia Sats | last post by:
Hi, I previously used CR v 4.6. After I created report and saved it as a file , I only need to add control in VB and set some properties . Inside VB such line of code : cr.PrintReport. And after...
0
by: david.kao | last post by:
As an IT developer, in past twelve years I spent great deal amount of time writing different kinds of reports. In past, as a VB developer I gave up Crystal Report about seven years ago. I was using...
3
by: chrisse_2 | last post by:
Hey, I have a report with multiple records and controls. There is one particular control called 'Further Reference' which is part of the report. It has a couple of standard phrases in it and...
0
by: Smokey Grindle | last post by:
I have a VB.NET application with the Report server 2005 .NET control on a form... when I run a report that has a document map with grouped items the map shows as a single collapsed node then I can...
2
by: cephal0n | last post by:
I need big hand of help coz I'm stuck in a huge puddle of access mess I made. I need to view my query in a report, I know it's easy for access because it provides a custom made report and you need...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.