Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date functions in mysql

Status
Not open for further replies.

mickit

Programmer
Jul 14, 2004
3
DE
hello

i made a small mistake but i don't want to rewrite my script
so perhaps there is an other way

i have 3 int values standing for year moth day
i didn't use the unixtimestamp - and yes i kn ow this would be easier

so my question.

is there a way, to get all the entries, which are in the future

like this:
where DATE(year,monthm,day) >= 'act_time'

??
 
where DATE(year,month,day)>= curdate()

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I think you would have to do it like this:
[tt]
WHERE
CONCAT(
year,'-',LPAD(month,2,'0'),'-',LPAD(day,2,'0')
)
>=CURDATE()
[/tt]

assuming the year is in 4-digit form.

This is likely to be quite slow though, so you might be better off restructuring your table to use a DATE field if possible.


-----
ALTER world DROP injustice, ADD peace;
 
hm none of them are working - no errormsg - just no results
damn

any other ideas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top