G
Greg
We have a requirement to display a date range in a groupboxes text property.
The dates are stored in a DataTable named "names" in the "names_beghold" and
the "names_endhold" DataColumns. The default value is "1/1/1800" and is a
DateTime type. We only want to show the dates if they are not the default.
The text of the GroupBox needs to change as the DataColumn values change.
So, we thought this would be a good case for an expression on a custom
column. We can then databind the groupboxes text property to the custom
column.
The below expressions works:
"IIF(names_beghold<>#1/1/1800# AND names_endhold<>#1/1/1800#,
Convert(names_beghold,'System.String') + ' to ' +
Convert(names_endhold,'System.String'), '')"
Its output, when the dates are not 1/1/1800, looks like this:
"5/1/2002 12:00:00 AM to 8/1/2002 12:00:00 AM"
We need a way to strip off the trailing times. We were thinking about
SUBSTRING, however the month and day could be 1 or 2 positions.
Any other ways to strip off the "12:00:00 AM" within an expression?
I'm a blogger: http://dotnetrocks.blogspot.com/
The dates are stored in a DataTable named "names" in the "names_beghold" and
the "names_endhold" DataColumns. The default value is "1/1/1800" and is a
DateTime type. We only want to show the dates if they are not the default.
The text of the GroupBox needs to change as the DataColumn values change.
So, we thought this would be a good case for an expression on a custom
column. We can then databind the groupboxes text property to the custom
column.
The below expressions works:
"IIF(names_beghold<>#1/1/1800# AND names_endhold<>#1/1/1800#,
Convert(names_beghold,'System.String') + ' to ' +
Convert(names_endhold,'System.String'), '')"
Its output, when the dates are not 1/1/1800, looks like this:
"5/1/2002 12:00:00 AM to 8/1/2002 12:00:00 AM"
We need a way to strip off the trailing times. We were thinking about
SUBSTRING, however the month and day could be 1 or 2 positions.
Any other ways to strip off the "12:00:00 AM" within an expression?
I'm a blogger: http://dotnetrocks.blogspot.com/