Solved

total text column in ssrs

Posted on 2011-03-09
8
441 Views
Last Modified: 2012-05-11
I Have a table that has text fields and I want to Total only those records that don't contain the "2009-02" format in them.  Is it possible in SSRS?

I tried this but it doesn't work.  

=IIF(Fields!Month4.Value <"2009",Fields!Month4.Value,Sum(cint(Fields!Month4.Value))
=IIF(Fields!Month4.Value <"2009",Fields!Month4.Value,Sum(cast(Fields!Month4.Value as int))

 SAMPLE DATA
0
Comment
Question by:epicazo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 27

Expert Comment

by:planocz
ID: 35090363
where is this field coming from?  "2009-02" Is this a string field?
do you want a total at the bottom?
Please explain again.
0
 

Author Comment

by:epicazo
ID: 35097810
field is called MONTH1,MONTH2,MONTH3, etc... and these are NVARCHAR fields
0
 
LVL 27

Expert Comment

by:planocz
ID: 35097903
do you want a total at the bottom of each column?
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:epicazo
ID: 35101434
I want to summarize each column except for the row that contains 2009-02, 2009.03, etc..
0
 
LVL 27

Expert Comment

by:planocz
ID: 35102681
your example does not show me what you are wanting to do. You have 2011 in the example and no real way of showing the layout of want you are doing. If you are trying to not read a 2009-2 then the best way would be in your query and then just have the report print out the results.
0
 

Author Comment

by:epicazo
ID: 35112242
I hope I am able to explain myself on this...

I am in reporting services and the columns I am trying to get a SUM on MONTH1--MONTH24 and as depicted in the image above my data output is in text because I am running a crosstab SP to get the results for a 24 month period to include the HEADER (The header is the row of data that contains YYYY-MM) it is written then way becuse every month the header will be different.  

I want a summary on everything, except those that contain YYYY-MM

I tried this syntax  but it doesn't work for me:
=IIF(Fields!Month4.Value ="2009-03",Fields!Month4.Value,Sum(cint(Fields!Month4.Value))


Thanks...
0
 

Accepted Solution

by:
epicazo earned 0 total points
ID: 35113035
I figured it out.  

=IIF(Sum(cint(Fields!Month1.Value))<0,FIELDS!Month10.Value,Sum(cint(Fields!Month1.Value)))
0
 

Author Closing Comment

by:epicazo
ID: 35145576
Questions could be deleted.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question