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 the need for indexing?
How to check table values in sql server?
what is isolation level at dead lock?
How would we use distinct statement? What is its use?
What is the use of floor function in sql server?
Explain transaction server isolation?
Where is localdb stored?
What is sql server locking?
Explain tables in SQL Azure?
According to you what goes into making the best database administrator? : sql server database administration
What is catalog views?
Name some of the open source software that you can use in alternative to SSR?
What is row_number()?
How do you troubleshoot errors in a SQL Server Agent Job?
How to defragment indexes with alter index ... Reorganize?