SamuelHenderson

Symbolize using date field

Discussion created by SamuelHenderson on Apr 26, 2011
Latest reply on Apr 28, 2011 by SamuelHenderson
Hi All,

I'm making an ICommand Extension for ArcMap 9.3.1.  Basically, I'd like to be able to look at a date field in a featureclass, and if it is older than 5 years (from the current date) it should be symbolized as a red point, and if the date is less than 5 years old it should be symbolized with a green point.

At first I thought a ClassBreakRenderer would be the solution using something like:
Dim classBreakRenderer As IClassBreaksRenderer = New ClassBreaksRenderer
classBreakRenderer.Field = "LAST_ACTIVITY_DATE"
classBreakRenderer.BreakCount = 2
classBreakRenderer.Break(0) = " < #" & DateTime.Now.AddYears(-5).ToShortDateString & "#"
classBreakRenderer.Break(1) = " >= #" & DateTime.Now.AddYears(-5).ToShortDateString & "#"

But it seems that the Break property requires a number and will not work for a date or string...

Is there some better way to go about doing what I need to do?  It seems like this should be a pretty typical operation...

Outcomes