- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Find date record after a particular date from a column with VARCHAR type in MySQL
Let us first create a table. Here, we have set date as VARCHAR −
mysql> create table DemoTable1364 -> ( -> ShippingDate varchar(100) -> ); Query OK, 0 rows affected (0.87 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1364 values('01-09-2019 12:34:55'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable1364 values('01-07-2018 17:10:00'); Query OK, 1 row affected (0.37 sec) mysql> insert into DemoTable1364 values('24-09-2019 10:31:22'); Query OK, 1 row affected (0.24 sec) mysql> insert into DemoTable1364 values('20-09-2018 13:00:00'); Query OK, 1 row affected (0.13 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1364;
This will produce the following output −
+---------------------+ | ShippingDate | +---------------------+ | 01-09-2019 12:34:55 | | 01-07-2018 17:10:00 | | 24-09-2019 10:31:22 | | 20-09-2018 13:00:00 | +---------------------+ 4 rows in set (0.00 sec)
Here is the query to find date record after a particular date from a column with VARCHAR type −
mysql> select * from DemoTable1364 -> where str_to_date(ShippingDate,'%d-%m-%Y %H:%i:%s') > str_to_date('2019-09-21 10:31:20', '%Y-%m-%d %H:%i:%s');
This will produce the following output −
+---------------------+ | ShippingDate | +---------------------+ | 24-09-2019 10:31:22 | +---------------------+ 1 row in set (0.00 sec)
- Related Articles
- Display record with today and tomorrow’s date from a column with date record in MySQL
- Order by date set with varchar type in MySQL
- Display records after a particular date in MySQL
- How to select a specific record from MySQL if date is in VARCHAR format?
- Comparison of varchar date records from the current date in MySQL
- MySQL select * and find record with current date
- How to update a MySQL date type column?
- Get maximum date from a list of varchar dates in MySQL
- Retrieve MIN and MAX date in a single MySQL query from a column with date values
- How to compare the first date and the last date from a MySQL column with date records?
- How MySQL evaluates if I store date along with time value in a column having DATE data type?
- Fetch a single ordered date from a column with MySQL LIMIT
- Display distinct dates in MySQL from a column with date records
- MySQL query to select records with a particular date?
- Update record on a specific date matching the current date in MySQL

Advertisements