Showing posts with label achieve. Show all posts
Showing posts with label achieve. Show all posts

Sunday, March 11, 2012

Conditional split on date ?

Hi,

I have a DT_DATE column. I'd like to achieve a conditional split to ignore all records for which the date is below a specific hardcoded date (eg: 2007-03-01).

I'm having a hard time trying to express this using the conditional split transform.

What is the correct syntax to express a DT_DATE literal ?

eg:
[date] < (DT_DATE) "2007-03-01"

regards

Thibaut

What you have should work fine. I built a little test package to verify, and each of these worked as expected:

Code Snippet

HireDate < (DT_DATE)"1998-01-30"

Code Snippet

[HireDate] < (DT_DATE)"1998-01-30"

Code Snippet

HireDate < (DT_DATE)"01/30/1998"

Code Snippet

[HireDate] < (DT_DATE)"01/30/1998"

What behavior are you experiencing that prompts you to ask the question?

|||Are you sure [date] is a DT_DATE column and not a DT_DBTIMESTAMP column? That is, does it contain a time component?

Just double checking.

Wednesday, March 7, 2012

Conditional Formatting

Hi all
Does anyone know how I can have conditional formatting in my reports?
What I want to achieve is something like. If the field text = "Green" make
the background green, etc
Thanks alot in advance
Ruse the iif function for the font color. Reporting Services accepts
expressions for most of its properties.
=iif(boolean condition, "red", "black")
HTH
Charles Kangai, MCT, MCDBA
"Rudi Groenewald" wrote:
> Hi all
> Does anyone know how I can have conditional formatting in my reports?
> What I want to achieve is something like. If the field text = "Green" make
> the background green, etc
> Thanks alot in advance
> R
>
>|||Hi charles,
Thanks that worked great, just one problem,
There is 4 possibilities. it can either be red, green, yellow or blue..
I tried this:
=iif( Fields!Shift.Value = "Green", "LawnGreen", "transparent")
else
=iif( Fields!Shift.Value = "Red", "Red", "transparent")
else
=iif( Fields!Shift.Value = "Yellow", "Yellow", "transparent")
else
=iif( Fields!Shift.Value = "Blue", "Blue", "transparent")
endif
but that don't quite help it. Any ideas?
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:4C2D7CCD-E8CB-4A5C-A7D9-9E2530CABA44@.microsoft.com...
> use the iif function for the font color. Reporting Services accepts
> expressions for most of its properties.
> =iif(boolean condition, "red", "black")
> HTH
> Charles Kangai, MCT, MCDBA
> "Rudi Groenewald" wrote:
>> Hi all
>> Does anyone know how I can have conditional formatting in my reports?
>> What I want to achieve is something like. If the field text = "Green"
>> make
>> the background green, etc
>> Thanks alot in advance
>> R
>>|||IIF is a function, not a procedural statement. Therefore you cannot use the
syntax you are trying to use. Is your logic something like this: if the value
of the Shift textbox is "green", "blue", "red" or "yellow", make the color of
this the same, otherwise make it transparent? if so, you need
=iif(Fields!Shift.Value="green" or Fields!Shift.Value = "blue" or
Fields!Shift.Value = "red" or Fields!Shift.Value = "yellow",
Fields!Shift.Value, "transparent")
or are you trying to make a distinction between green and lawngreen, in
which case you could nest a second iif function like so:
=iif(Fields!Shift.Value = "blue" or Fields!Shift.Value = "red" or
Fields!Shift.Value = "yellow", Fields!Shift.Value, iif(Fields!Shift.Value ="green", "lawngreen", "transparent"))
both of the above should work.
HTH
Charles Kangai, MCT, MCDBA
"Rudi Groenewald" wrote:
> Hi charles,
> Thanks that worked great, just one problem,
> There is 4 possibilities. it can either be red, green, yellow or blue..
> I tried this:
> =iif( Fields!Shift.Value = "Green", "LawnGreen", "transparent")
> else
> =iif( Fields!Shift.Value = "Red", "Red", "transparent")
> else
> =iif( Fields!Shift.Value = "Yellow", "Yellow", "transparent")
> else
> =iif( Fields!Shift.Value = "Blue", "Blue", "transparent")
> endif
> but that don't quite help it. Any ideas?
> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
> news:4C2D7CCD-E8CB-4A5C-A7D9-9E2530CABA44@.microsoft.com...
> > use the iif function for the font color. Reporting Services accepts
> > expressions for most of its properties.
> >
> > =iif(boolean condition, "red", "black")
> >
> > HTH
> >
> > Charles Kangai, MCT, MCDBA
> >
> > "Rudi Groenewald" wrote:
> >
> >> Hi all
> >>
> >> Does anyone know how I can have conditional formatting in my reports?
> >>
> >> What I want to achieve is something like. If the field text = "Green"
> >> make
> >> the background green, etc
> >>
> >> Thanks alot in advance
> >>
> >> R
> >>
> >>
> >>
>
>|||Hi Charles,
I figured it out, it was kind of simple really, just had to click. The
field "shift" only displays the words "red", "blue", "green" or "yellow".
So if that is the only words which are displayed, then obviously the
expression to be used as the background is =Fields!Shift.value
but your input made me click, thanks alot
Regards
R
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:CCA10812-58FB-43BD-B8FD-4C5B2BABC5AE@.microsoft.com...
> IIF is a function, not a procedural statement. Therefore you cannot use
> the
> syntax you are trying to use. Is your logic something like this: if the
> value
> of the Shift textbox is "green", "blue", "red" or "yellow", make the color
> of
> this the same, otherwise make it transparent? if so, you need
> =iif(Fields!Shift.Value="green" or Fields!Shift.Value = "blue" or
> Fields!Shift.Value = "red" or Fields!Shift.Value = "yellow",
> Fields!Shift.Value, "transparent")
> or are you trying to make a distinction between green and lawngreen, in
> which case you could nest a second iif function like so:
> =iif(Fields!Shift.Value = "blue" or Fields!Shift.Value = "red" or
> Fields!Shift.Value = "yellow", Fields!Shift.Value, iif(Fields!Shift.Value
> => "green", "lawngreen", "transparent"))
> both of the above should work.
> HTH
> Charles Kangai, MCT, MCDBA
> "Rudi Groenewald" wrote:
>> Hi charles,
>> Thanks that worked great, just one problem,
>> There is 4 possibilities. it can either be red, green, yellow or blue..
>> I tried this:
>> =iif( Fields!Shift.Value = "Green", "LawnGreen", "transparent")
>> else
>> =iif( Fields!Shift.Value = "Red", "Red", "transparent")
>> else
>> =iif( Fields!Shift.Value = "Yellow", "Yellow", "transparent")
>> else
>> =iif( Fields!Shift.Value = "Blue", "Blue", "transparent")
>> endif
>> but that don't quite help it. Any ideas?
>> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in
>> message
>> news:4C2D7CCD-E8CB-4A5C-A7D9-9E2530CABA44@.microsoft.com...
>> > use the iif function for the font color. Reporting Services accepts
>> > expressions for most of its properties.
>> >
>> > =iif(boolean condition, "red", "black")
>> >
>> > HTH
>> >
>> > Charles Kangai, MCT, MCDBA
>> >
>> > "Rudi Groenewald" wrote:
>> >
>> >> Hi all
>> >>
>> >> Does anyone know how I can have conditional formatting in my reports?
>> >>
>> >> What I want to achieve is something like. If the field text = "Green"
>> >> make
>> >> the background green, etc
>> >>
>> >> Thanks alot in advance
>> >>
>> >> R
>> >>
>> >>
>> >>
>>