July 22, 2010 at 3:56 pm
Hi guys!
i want to get all dates and titles from a calendar to display. at the moment il get all information trought :
SELECT * FROM calendar ORDER BY ev_dat
this shows me all titels/dates from my db, but i just wanna show the titel/dates from the calendar that hasnt come to past yet.
all news that is today or in the future should be displayed, not the"out of date" one.
my ev_dat is all dates saved in a varchar like yyyy-mm-dd.
using mysql.
any foughts?
/casper
July 22, 2010 at 4:23 pm
Change the column to the correct data type. Then you can perform calculations like you should be able too. Find the person that designed that table, and beat their *** for using the incorrect data type.
We need to stop allowing this kind of thing, and companies need to put a stop to accepting poorly written and designed software.
That really burns me when people who do not know what they are doing, try to design a database.
Andrew SQLDBA
July 22, 2010 at 4:40 pm
now ive changed the type to date:)
and i got it to work! ty:D
SELECT * FROM calendar WHERE ev_dat>=CURDATE() ORDER BY ev_dat
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply