Skip to main content
Participant
June 2, 2008
Question

Query for Day and Month Only

  • June 2, 2008
  • 2 replies
  • 286 views
I have a table with a date field that I need to query by day and month only. Basically, if I search for "04/15", the query would return records whose date includes: 04/15/2006, 04/15/2007, 04/15/2008, etc. How can I do that on SQL Server?

Thx!
    This topic has been closed for replies.

    2 replies

    Inspiring
    June 3, 2008
    Or something a bit easier

    Where Month(tableColumn) = 4
    And Year(tableColumn) = 2007

    Ken
    June 2, 2008
    ColdFusion and SQL Server have functions called DatePart.

    ColdFusion

    SQL Server