TheDeveloper
TheDeveloper

Reputation: 62

Checking Values Stored In A Column In A Date of Birth Format in Database

I am currently trying to get all records in a database that have a date of birth set to a future date. But I am not sure how to check the existing values stored and make sure they are greater than/less than today's date.

Currently all I have is,

select * from [table_name]
where [column_name] =  .........;

the formats of the saved dates are DD-FEB-YY and they are stored in a column within a person table.

Upvotes: 0

Views: 44

Answers (1)

TheValyreanGroup
TheValyreanGroup

Reputation: 3599

Use the CURDATE() function to get today's date. This will return all records later than today:

SELECT * FROM table WHERE dateColumn > CURDATE()

Upvotes: 1

Related Questions