0

In my database I have a Date stored as a String, I would like to query a range of dates, server-side. Unfortunately it is a third-party application so I cannot change the schema.

Normally, in MySQL I would use STR_TO_DATE(), or CONVERT().

How can I query a string date in MySQL using the Entity Framework when it doesn't support things like DateTime.Parse()?

Adam Reed
  • 229
  • 4
  • 16
  • 1
    optimally, change your database schema to hold a Date in that column. – Jonesopolis Aug 27 '15 at 15:07
  • Unfortunately it's a third party database and I cannot do that. – Adam Reed Aug 27 '15 at 15:16
  • then you could pull from the database into memory, and cast your datetimes, and query that – Jonesopolis Aug 27 '15 at 15:19
  • I am aware of that, but if you review my question, I am looking to perform that server side. I am working with far too much data to pull the data to the client. So that won't work unfortunately. – Adam Reed Aug 27 '15 at 15:22
  • Maybe this solution is suitable for you: http://stackoverflow.com/questions/6708996/convert-from-to-string-in-database-to-boolean-property-entity-framework-4-1 – Andrey Aug 27 '15 at 17:47

0 Answers0