I ended up using my existing code for "On" comparisons, and just doing a strict >
or <
for before and after as Corak suggested.
if (Comparison == ComparisonType.Equals) {
return string.Format("({0}.Year {2} @{1}.Year && {0}.Month {2} @{1}.Month && {0}.Day {2} @{1}.Day)", FieldName, index, ComparisonType.Equals.Evaluate()); //workaround for "exactly equals date"
} else if (Comparison == ComparisonType.Less_Than) {
Value = ((DateTime)Value).Minimize(); //set the time values of the date to the minimums (00:00:00 000)
} else if (Comparison == ComparisonType.Greater_Than) {
Value = ((DateTime)Value).Maximize(); //set the time values of the date to the maximums (23:59:59 999)
}
return string.Format("({0} {1} @{2})", FieldName, Comparison.Evaluate(), index);