Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Matrix with multiple data formats

Author  Topic 

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2009-10-09 : 06:23:02
Hi

Im creating a grid with the following query:

Select Product, Content, 'Date of release' AS Label, convert(varchar, datevalue) AS Unit
From tablea
UNION ALL
Select Product, Content, 'Unit of download' AS Label, convert(varchar, Unit) AS Unit
from tablea

In the grid i need to format the numbers as they come out as raw numbers so I have a IIF running in the grid

iif((Fields!Label.Value = "Date of release"), Fields!Unit.Value, formatnumber(Fields!.Unit.Value))

It formats the numbers perfectly to what I want, but the date value just displays '#Error'

But if I remove the IIF and just display Fields!Unit.Value it shows all the data fine but not formatted.

Any help please, its quite urgent

Many Thanks

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-10-09 : 08:40:36
How about, on your Format option for that field, build the expression the same was as the one that determines what to display?
I am assuming that if Value="Date of release" you want something like dd/MM/yyyy. What is the format supposed to be if false?

John
Go to Top of Page

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2009-10-09 : 08:52:27
the IIF statement im using it for if the value is that then show the date from that value, if false then formatnumber the value.

But ive sorted it now anyways

quote:
Originally posted by JCirocco

How about, on your Format option for that field, build the expression the same was as the one that determines what to display?
I am assuming that if Value="Date of release" you want something like dd/MM/yyyy. What is the format supposed to be if false?

John

Go to Top of Page
   

- Advertisement -