colourtheweb
colourtheweb

Reputation: 777

How can I fetch data for future dates in MySQL

I want to get the future game playing date. Field game_date is in format of d/m/Y and data type is varchar.

I am running this query. There are records available in the database but this query isn't fetching any data. Please help

Query

SELECT * FROM dx_scores
WHERE
    t_name='Team 11'
    and username='[email protected]'
    and STR_TO_DATE(game_date, '%d/%m/%Y' ) >= CURDATE();

Upvotes: 1

Views: 851

Answers (1)

Praveen kalal
Praveen kalal

Reputation: 2129

Please try this query

SELECT * FROM dx_scores WHERE t_name='Team 11' and username='[email protected]' and DATE(game_date, '%d/%m/%Y' ) >=  DATE(CURDATE());

Upvotes: 1

Related Questions