Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Date question

Guest
Jun 11, 2010 Jun 11, 2010

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?

578
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Jun 11, 2010 Jun 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

Translate
Participant ,
Jun 11, 2010 Jun 11, 2010

Your best bet is a good old SQL statement.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 11, 2010 Jun 11, 2010

How would the sql statement look like:

SELECT *

FROM tbl_jobs

WHERE date ????

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 11, 2010 Jun 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 11, 2010 Jun 11, 2010
LATEST

Perfect, that worked liked a champ. Thanks a lot, appreciate your help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources