N
Nick Carter
I want to create a filter on a DataView for a time column. I have a column
called StartTime in a SQL Server database which is defined as a DateTime
column but it only contains times. I want to find all rows which are after
12:00:00 so I write the following line:-
DataView dataView = new DataView(dataSet.Tables["Deliveries"],
"Substring(Convert(StartTime, 'System.String'), 12, 8) > '12:00:00'", "",
DataViewRowState.CurrentRows);
but its not very elegant. Is there a better way of expressing a time
comparison other than converting it to a string and doing a character
comparison of the substring ?
Nick Carter
called StartTime in a SQL Server database which is defined as a DateTime
column but it only contains times. I want to find all rows which are after
12:00:00 so I write the following line:-
DataView dataView = new DataView(dataSet.Tables["Deliveries"],
"Substring(Convert(StartTime, 'System.String'), 12, 8) > '12:00:00'", "",
DataViewRowState.CurrentRows);
but its not very elegant. Is there a better way of expressing a time
comparison other than converting it to a string and doing a character
comparison of the substring ?
Nick Carter