-
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.
-
This is what i understood from your question you want to query your database on a date/time field, but only by month.
-
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