Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: , +
I couldn't find  this 17-dec-84 format


What I have tried:

DATE - format YYYY-MM-DD
DATETIME - format: YYYY-MM-DD HH:MI:SS
SMALLDATETIME - format: YYYY-MM-DD HH:MI:SS
TIMESTAMP - format: a unique number
I Have came through all these FORMATS but i couldn't find  this 17-dec-84 format
plsss HELP :-(
Posted
Updated 14-Nov-17 22:52pm
v2
Comments
Richard MacCutchan 15-Nov-17 4:25am    
Dates and DateTimes are value types. You only need a format when displaying them on some human readable device.
Cute princess 15-Nov-17 4:30am    
how to insert 17-dec-84 in sql server
Richard MacCutchan 15-Nov-17 4:34am    
Convert it to a Date type. If you really do not understand date and time handling in SQL then you are likely to run into many problems in the future. Go and study the SQL documentation for the different field types.
John C Rayan 15-Nov-17 4:33am    
If you are using SQL, then you have to use convert(datetime, '17-DEC-84', 5)
Cute princess 15-Nov-17 4:48am    
Thank u but it's not worked
INSERT INTO EMPLOYEE(EMPLOYEE_ID,LAST_NAME,FIRST_NAME,MIDDLE_NAME,JOB_ID,MANAGER_ID,HIREDATE,SALARY,COMM,DEPARTMENT_ID)VALUES(7369,'SMITH','JOHN','Q',667,7902,(CONVERT(DATETIME('84-DEC-17',5))),800,NULL,20);

Incorrect syntax near '84-DEC-17'.

1 solution

convert(datetime, '17-DEC-84', 5)
 
Share this answer
 
Comments
John C Rayan 16-Nov-17 11:37am    
you have copied exactly my solution. ????????????. Read it carefully.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900