I have one column in my database that I need to convert from datetime to the date data type using a SQL Server function. I can't figure out how to get the correct syntax. Could I get some help with the syntax so IntelliSense will stop yelling at me and I can get the query to run?
CREATE FUNCTION fChangeDateFormat (@date01 date)
RETURNS DATE
AS
RETURN(
SELECT
Convert(DateTime, OrderDate, 101)
FROM
Orders
WHERE
OrderDate = @date01
)