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 name query output columns in ms sql server?
Will sql server 2005 allow you to reduce the size of a column?
What is sql server replication? : sql server replication
Explain in brief about Microsoft SQL server?
What are the High-Availability solutions in SQL Server and differentiate them briefly?
Explain error and transaction handling in sql server?
What does REVERT do in SQL Server 2005?
Explain sql server authentication modes?
Explain cdc and sql injection?
Is oracle faster than sql server?
Where can you find the error log information? : sql server database administration
what are the steps you will take to improve performance of a poor performing query? : Sql server database administration
What is the Main Difference between ACCESS and SQL SERVER?
What is the difference between locking and multi-versioning?
What are the advantages of using stored procedures in sql server?