Try this
Cast('7/7/2011' as datetime)
and
Convert(DATETIME, '7/7/2011', 101)
See CAST and CONVERT (Transact-SQL) for more details.
More Related Contents:
- How to get Time from DateTime format in SQL?
- T-SQL: Opposite to string concatenation – how to split string into multiple records [duplicate]
- Check if table exists in SQL Server
- Insert multiple rows WITHOUT repeating the “INSERT INTO …” part of the statement?
- SQL query to select dates between two dates
- Does T-SQL have an aggregate function to concatenate strings? [duplicate]
- Parameter Sniffing (or Spoofing) in SQL Server
- What is the significance of 1/1/1753 in SQL Server?
- SQL Server String or binary data would be truncated
- Datatype for storing ip address in SQL Server
- How to change identity column values programmatically?
- Cannot truncate table because it is being referenced by a FOREIGN KEY constraint?
- How much size “Null” value takes in SQL Server
- best way to convert and validate a date string
- SQL – The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
- Date conversion and culture: Difference between DATE and DATETIME
- SQL Server ORDER BY date and nulls last
- SQL Query to find the last day of the month
- How to remove accents and all chars a..z in sql-server?
- Find non-ASCII characters in varchar columns using SQL Server
- Aggregate bitwise-OR in a subquery
- How can I get the sum of multiple datetime values?
- SQL server schema and default schema
- Check if a string contains a substring in SQL Server 2005, using a stored procedure
- Cannot find either column “dbo” or the user-defined function or aggregate “dbo.Splitfn”, or the name is ambiguous
- Does query plan optimizer works well with joined/filtered table-valued functions?
- What are row, page and table locks? And when they are acquired?
- Convert UTC Milliseconds to DATETIME in SQL server
- @@ERROR and/or TRY – CATCH
- How to calculate difference in hours (decimal) between two dates in SQL Server?