Results 1 to 3 of 3

Thread: SQL Statement

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    7

    Exclamation SQL Statement

    I would like to know that how can I use SQL Statement to access the data from my database , referring by the month (datatype is Date/time dd/mm/yy)
    if anyone know about this SQL Statement ,please let me know.I need this code to handle with my project,
    thank you very much.
    KOGEPAN

  2. #2
    Frenzied Member jjortiz's Avatar
    Join Date
    Mar 2001
    Location
    NYC
    Posts
    1,768
    This is what i understood from your question you want to query your database on a date/time field, but only by month.

  3. #3
    Frenzied Member jjortiz's Avatar
    Join Date
    Mar 2001
    Location
    NYC
    Posts
    1,768
    Do a search on Books Online for DatePart Function. You have to do something like
    This will pull all the records for November. I hope this help.
    Code:
    SELECT hire_date FROM [pubs].[dbo].[employee]
    where  datepart(month,hire_date) = 11
    Last edited by jjortiz; May 27th, 2001 at 02:22 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width