Click here to Skip to main content
15,791,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to convert long int to date time

samplvalue 978312168 convert it date time in sql sercer

What I have tried:

Please Help to solve this problem
Posted
Updated 24-Nov-16 18:43pm
Comments
Suvendu Shekhar Giri 24-Nov-16 3:19am    
What!!!
Seriously?
Why do you want to convert a long int to a datetime?
Which database are you using?
What is the logic to get date time components from it?
Suvendu Shekhar Giri 24-Nov-16 3:20am    
Well, there is no "long int" in SQL Server, you probably are referring to "bigint".
moin1 24-Nov-16 4:22am    
From attendance machine i get long int and need to convert into date time
Patrice T 24-Nov-16 3:37am    
What is supposed to be "978312168" ? where does it come from ?
moin1 24-Nov-16 4:22am    
From attendance machine i get long int and need to convert into date time

 
Share this answer
 
SQL
Select Convert(DATETIME, LEFT(978312168, 9))
 
Share this answer
 
Comments
moin1 25-Nov-16 23:12pm    
Do not work

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