D
D
DireX2016-04-07 16:27:42
SQL
DireX, 2016-04-07 16:27:42

How to convert string (in timestamp string) to date in ms sql?

Good afternoon. There is a table:

--------------------------------------------
|id (int)|name (varchar) | date (varchar)  |
|------------------------------------------|
| 1      |Nikolay        | 14496658        |
| 2      |Artem          | 14498711        |
--------------------------------------------

How can I convert the date field to DATETIME or DATE in a query.
Probyval:
SELECT 
  CAST(CAST(names.date AS TIMESTAMP) as DATE) as create_date,
  name as profile_name,
  id as id_name
FROM names

But no result.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Karetnikov, 2016-04-07
@xDireX

What does "to no avail" mean? Such a request will return the data to you, it will be 1900.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question