1

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();
2
  • 3
    make sure future data for given where condition is available in DATABASE Commented Apr 26, 2013 at 9:54
  • 4
    wouldn't be easier to change the data type? Commented Apr 26, 2013 at 9:55

1 Answer 1

1

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());
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.