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
What is report rendering ?
Please explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?
How to change server name in sql server?
What is the default port for SQL Server over a firewall?
What according to you is the difference between mysql and sql server performance?
Can we use having clause without group by?
What is query cost in sql server?
What are some examples of schemas?
Where the sql logs gets stored? : sql server database administration
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
Write a sql query to display the current date?
What do you understand by recursive stored procedure?
why would you use sql agent? : Sql server database administration
What are the reporting services components?
What do you mean by collation recursive stored procedure?