Showing posts with label level. Show all posts
Showing posts with label level. Show all posts

Friday, March 9, 2012

Dynamically Changing the Picture at the Record Level.

Hi,
Appreciate your help on the following.
I need to display images according to the status of the record. For example,
I am displaying product list where the margin is less than 15% then display
image1, when margin is between 16% and 25% display image2 etc. I am currently
using a table to store the path of the images.
Thank you again,
KG@.SF
Highly appreciate your helpI also have to develop similar concept but Matrix report where I have to
again display image indicators when a category of product margin falls betwen
a certain range. Appreciate your help,
KG
"KG@.SFC" wrote:
> Hi,
> Appreciate your help on the following.
> I need to display images according to the status of the record. For example,
> I am displaying product list where the margin is less than 15% then display
> image1, when margin is between 16% and 25% display image2 etc. I am currently
> using a table to store the path of the images.
> Thank you again,
> KG@.SF
> Highly appreciate your help

Friday, February 24, 2012

Dynamic Summing

I have a 4th level grouping that has just 3 different values to group on (No
Cat, New and Current). I want to sum a field on that level, but only if the
grouping is not = "current". The sum can be in the 3rd or 4th level grouping,
whichever works. So something like this, but this doesn't work:
=SUM(IIF(LTRIM(RTRIM(Fields!Type.Value))<>"CURRENT",Sum(Fields!CurrMthSales.Value),0))I think it should be something like this. (You don't need the extra sum in
your formula)
=SUM(IIF(LTRIM(RTRIM(Fields!Type.Value))<>"CURRENT",Fields!CurrMthSales.Value,0))
"Chris Patten" wrote:
> I have a 4th level grouping that has just 3 different values to group on (No
> Cat, New and Current). I want to sum a field on that level, but only if the
> grouping is not = "current". The sum can be in the 3rd or 4th level grouping,
> whichever works. So something like this, but this doesn't work:
> =SUM(IIF(LTRIM(RTRIM(Fields!Type.Value))<>"CURRENT",Sum(Fields!CurrMthSales.Value),0))
>

Friday, February 17, 2012

Dynamic SQL question

Can someone tell me why the exec statement throws the following error?
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '-'.

Code Snippet

create table #t (Val1 smallint, Val2 smallint )
go
DECLARE @.Diff as int;
set nocount on

insert into #t values(10, 15)

--Why does this work?
SET @.Diff=(SELECT Val2 FROM #t) - (SELECT Val1 FROM #t)
select @.Diff

--And yet this does not?
EXEC('(SELECT Val2 FROM #t) - (SELECT Val1 FROM #t)')

drop table #t
go


Thanks

Colin

It is because you dont have a SELECT or anything in your dynamic sql.

change to:

Code Snippet

EXEC('SELECT (SELECT Val2 FROM #t) - (SELECT Val1 FROM #t)')

and it works fine.