7

i have the next query: select avHours, date_add('2010-01-20', Interval 2 DAY) from tbl_available order by avHours;

but it returns a blob field and not a date field. when i see the value in the blob field, it's the right date.

how can i fix this?

Thanks in advance!

Nick
  • 575
  • 10
  • 29

1 Answers1

12

MySQL functions sometimes converts to BLOB. You can fix it if you will cast result to a DATE type yourself, for example -

SELECT DATE(DATE_ADD('2010-01-20', INTERVAL 2 DAY))

or

SELECT CAST(('2010-01-20' + INTERVAL 2 DAY) AS DATE)
Devart
  • 119,203
  • 23
  • 166
  • 186