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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Custom Code with AND
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sz1
Aged Yak Warrior

United Kingdom
555 Posts

Posted - 04/23/2013 :  03:51:51  Show Profile  Reply with Quote
IS it possible to add the AND clause to a piece of custom code in the Font colour expression, so

=Code.fnGetConditionalColor(Fields!Agreed_Solved_Date___Time.Value AND(Fields!Within_Flag = "1")

Thanks

SZ1
Learning and development is the driving force in the universe...!

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 04/23/2013 :  08:34:29  Show Profile  Reply with Quote
You can - probably this?
=Code.fnGetConditionalColor(Fields!Agreed_Solved_Date___Time.Value)  AND(Fields!Within_Flag = "1"


Go to Top of Page

sz1
Aged Yak Warrior

United Kingdom
555 Posts

Posted - 04/23/2013 :  09:43:22  Show Profile  Reply with Quote
Yeah thats coming back as black only? here is the function that works the colour out, I added this to all the font expressions. Wonder if I can add the AND(Fields!Within_Flag = "1" statements to each of the color parts here?





Public Function fnGetConditionalColor(pDate as datetime) AS String

Dim d AS integer
Dim c as string
d= DateDiff("d", pDate.Date, Now.Date)
IF d<0 and (Fields!Within_Flag = "0"
THEN
c="Green"
ELSE IF d =0 and d <=1 and (Fields!Within_Flag = "1" THEN
c="Red"
ELSE
c="Blue"
END IF

Return c

End Function

SZ1
Learning and development is the driving force in the universe...!

Edited by - sz1 on 04/23/2013 09:44:38
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000