create table with fields ID, reserved_by,res_date
res_date is datefield like 2010-03-09 00:00:00.000 from
2005 to 2006 any date assume
based on res_date need to slect table and display
based on month (full jan details in database irrespective
of date and year
Answer Posted / anilkumar manthena
select * from <Table> where datepart(month,res_date)=1
It will return all the reservations made on Month "January".
Ex:
SELECT DATEPART(month, '2009-02-13 18:35:06.523')
retrieves the value 2.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How to verify the port number of the sql server?
What is user-defined functions? What are the types of user-defined functions that can be created?
What the different components of Replication and what is their use?
What are key constraints?
Tell me what are cursors and when they are useful?
Explain powershell included in sql server 2008?
How will you optimize a stored procedure optimization?
What is the osql utility?
Does group by or order by come first?
Mention what are the core components of ssrs?
Define primary key?
How to automatically create a log when an exception is being received into SQL Server?
What is report snapshot?
List out some of the requirements to set up a sql server failover cluster?
What are the different types of sub-queries?