Jump to content

Recommended Posts

hi;

I inserted my date into a normal text in the format of DD-MM-YY and i want to use the where in mysql.

Example;

SELECT * from table WHERE thedate > todays date

 

What i am trying to ask for is a different way of finding days that are before today in mysql.

 

Thankyou

Paul

Link to comment
https://forums.phpfreaks.com/topic/161667-help-with-curdate-not-working/
Share on other sites

SELECT * from table WHERE thedate > todays date will give You the dates that are larger then today's date.

Do you have that kind of record?

 

Maybe try: SELECT * from table WHERE thedate >= todays date;

 

And try printing out "thedate" to see if the format matches

Why not store it as the 'date' type so you can perform logical operations like this?

 

P.S. - thedate > today's date makes no sense.  If you want the dates that come before today's date, then it would be thedate < today's day.

Is there a way to convert data already in the table to this format?

 

Dathremar; It doesn't work but thankyou all the same.

 

Thankyou all

Paul

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.