Naveh Naveh - 2 months ago 7
ASP.NET (C#) Question

How to get all the dates which are bigger from a specific date

I have a column named 'date' in MySQL which have different values of different dates as a string.

Values examples:


2016-09-29 02:19 AM

2016-09-29 02:09 AM

2016-09-29 02:07 AM

2016-09-29 01:51 AM


Now how do I get all the dates which are bigger than the date:


2016-09-29 01:52 AM


Is there a SQL statement or a ASP.NET code I can use?
Is it possible to use a LIMIT to get each time only one specific date?

Answer

I think the best solution is convert the table field to a date..

Anyway. If you want to use string as date and want to do that query try this:

select * 
from tblName 
where cast(date as datetime) > '2016-09-29 01:52'