'data type for the date as 16-Apr-82 in mssql?
what datatype should be used with the input date as 16-Apr-82 in mssql?the table demands that the date be inputted as 16-Apr-82.
Solution 1:[1]
You can user Varchar(11) to store date see below format for date-
select CONVERT(VARCHAR(11),REPLACE(CONVERT(VARCHAR(11),getdate(), 106), ' ', '-'))
However it is recommended to use default SQL date datatype.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nishant |
