0

Hi,

I have a calendar table that has event comments and a date tagged to it.

I would like to view "Upcoming Events" only.

I was wondering what type of syntax I'll need to be using?


heres how the table would look:

comment | d1 | d2 | d3
----------------------------
bobs bday....11....18... 2006
my bday .... 8....30... 2006
erics bday... 9.... 29... 2006
----------------------------

SELECT comment FROM calendar where CURRENT_DATE() < 'd1-d2-d3'

Thats my guessing...I tried looking for places to see what correct syntax to use but im just still lost. I work with sql a lot but never really syntax that compares dates and time.

Thanks,
Bobby

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by mmonaco27
0

You're close but consult the MySQL (I'm assuming that's your db) documentation for the correct timecode format. I think its YYYYMMDDHHMMSS (and you may insert 0s wherever you want.) so:

SELECT comment FROM calendar WHERE CURRENT_DATE() < 'd3d2d1000000';

If that single quoted string is a valid way to truncate variables and additional strings in SQL ( I don't remember sorry)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.