|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RowFilter on a DateTime value (both Date & Time)I have the need to be able to filter a DataTable on a column being between
two datetime values. The following works if there is no time stored : string strRowFilter = "StartDate <= " + dtStart.ToString() + " AND " + "EndDate >= " + dtEnd.ToString(); However, dtStart or dtEnd has a time, then I get a "Unhandled Exception: System.Data.SyntaxErrorException: Syntax error: Missing operand after '12' operator." (the time in dtStart is 12:00:00). How do I format the RowFilter string to handle both a date and time value? Thanks in advance! |
|||||||||||||||||||||||