getting information based on DateTime
-
I have the following table field name = "ordDate" which holds DateTime for orders. Ive tried the query below but without success. I need to get all information based on the passed "DateTime". any help will be apreciated select * from order WHERE ord_date = CONVERT .ToDateTime('14/09/1994')
-
I have the following table field name = "ordDate" which holds DateTime for orders. Ive tried the query below but without success. I need to get all information based on the passed "DateTime". any help will be apreciated select * from order WHERE ord_date = CONVERT .ToDateTime('14/09/1994')
select * from order WHERE ord_date = @ComparedDate
@ComparedDate is a DateTime parameter, you have to provide it's value from caller.Dim cmd as new SqlCommand(select * from order WHERE ord_date = @ComparedDate", conn) cmd.Parameters.Add(new SqlParameter("@ComparedDate", SqlDataType.DateTime)).Value=Convert.ToDateTime("14/09/1994") Dim reader as SqlDataReader=cmd.ExecuteReader() ...