views:

42

answers:

2

How to write a sql statement to retrieve repeated yearly event, which mean retrieve all the event regardless year only match with month and date.

Select * from Event where [date] = date ?
A: 

You can use MONTH() and DAY() for this:

SELECT
    *
FROM
    Event
WHERE
    MONTH([date]) = 12
AND
    DAY([date]) = 25
Sohnee
A: 

You can use the DAY() and MONTH() functions on a date field

SELECT * FROM Event WHERE MONTH(Date) = '7' AND DAY(Date) = '4' 

That would get you all events that happen on the 4th of July, regardless of the year.

kenny.r