In my db I have a series of projects, each with a StartDate and EndDate.
So, for example...
Name: Project 1; StartDate: 1/1/2009; EndDate: 12/31/2009
Name: Project 2; StartDate: 7/1/2007; EndDate: 6/30/2012
When displaying these projects, I only want to display the year AND if the start and end dates are in the same year, I would only like to show the year once (i.e., 2009 rather than 2009-2009)
So, for the above example, I'd like the output to be...
Project 1 (2009)
Project 2 (2007-2012)
How can I compare just the years from the date fields to determine whether to output (StartDate.Year) or (StartDate.Year-EndDate.Year) in my template?
Thanks so much!
Cheers,
Laurie