Skip to main content
June 11, 2010
Answered

Date question

  • June 11, 2010
  • 1 reply
  • 683 views

I have the following table:

tbl_jobs

======================

id                    date

======================

1                    06-10-2010

2                    06-15-2010

3                    04-13-2010

4                    05-05-2010

5                    02-02-2010

I am trying to do a query on this table to be able to get all the id's that have a date with the month 06.

Does anyone know how i could do something like this?

    This topic has been closed for replies.
    Correct answer Abram Adams

    What kind of database are you hitting?  Most have date functions such as Month() that will strip the month out of your date.  So something like:

    SELECT *

    FROM tbl_jobs

    WHERE Month(date) = 6

    1 reply

    Inspiring
    June 11, 2010

    Your best bet is a good old SQL statement.

    June 11, 2010

    How would the sql statement look like:

    SELECT *

    FROM tbl_jobs

    WHERE date ????

    Abram AdamsCorrect answer
    Inspiring
    June 11, 2010

    What kind of database are you hitting?  Most have date functions such as Month() that will strip the month out of your date.  So something like:

    SELECT *

    FROM tbl_jobs

    WHERE Month(date) = 6