-1
SELECT CAST(CONVERT(varchar, dateissued, 105) AS date) FROM table1;

The above SQL statement returns null values instead of expected values. I cannot spot the error.

pid
  • 11,472
  • 6
  • 34
  • 63
  • Which DBMS do you use? MySQL or SQL-Server? Due to the fact that you use `CONVERT` I guess you use SAL-Server. – Ionic Jun 20 '15 at 06:35
  • possible duplicate of [How to return the date part only from a SQL Server datetime datatype](http://stackoverflow.com/questions/113045/how-to-return-the-date-part-only-from-a-sql-server-datetime-datatype) – Gábor Bakos Jun 20 '15 at 06:48
  • Don't you know if you're working with SQL Server or Sybase IQ? – James Z Jun 20 '15 at 08:53

2 Answers2

0

Try this:

SELECT CONVERT(nvarchar(50),CONVERT(date,dateissued ,105)) as newDate
Ionic
  • 3,884
  • 1
  • 12
  • 33
0

These SQL will useful to you.

SELECT DATE_FORMAT('2010-06-25 09:16:04','%m/%d/%Y') AS DATE 

Thank you

Venkatesh Panabaka
  • 2,064
  • 4
  • 19
  • 27