I want to conver开发者_Python百科t a DATETIME
field (DateOfBirth)... When I execute the following query it says invalid syntax near convert
SELECT e.Emp_Id,e.Emp_Name,e.Address,e.Department,
(convert(varchar, e.Date_Of_Birth, 103) as Date_Of_Birth) from Employee as e
But when I execute the below query it gives result but my dateofbirth column name is (No Column Name)
SELECT e.Emp_Id,e.Emp_Name,e.Address,e.Department,
(convert(varchar, e.Date_Of_Birth, 103)) from Employee as e
Why cant I give an alias name as column name to a convert function?
Drop the extra comma:
SELECT e.Emp_Id,e.Emp_Name,e.Address,e.Department,
convert(varchar, e.Date_Of_Birth, 103) as Date_Of_Birth
FROM Employee as e
精彩评论