checking if date field is null

Hello,

I'm trying to check if a DateTime field is null and eventually found that the following was returning the year 0001 when the DateTime field was null:

the following doesn't work because it will return '1' for a null DateTime entry:

bool taskExecuted = !string.IsNullOrEmpty(((DateTime)Report.GetColumnValue("Task.ExecuteTime")).ToString())

I eventually used this method which is working but feels wrong:

bool taskExecutedYearX = !((DateTime)Report.GetColumnValue("Task.ExecuteTime")).Year.ToString().Equals("1")

Is there a better way to check a nullable DateTime field in FR?

Thank you.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.