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
Can we add a cpu to sql server?
What language is sql server written in?
What is abstracting periodical?
What are partitioned views?
How are the unique and primary key constraints different?
What are the recovery models in sql server 2000?
Can we shrink data file in sql server?
Can an entity have two primary keys?
What are indexes in sql?
Explain about temporary stored procedure?
What is a heap?
What is the cartesian product of the table?
What is a join in sql? What are the types of joins?
What sql server means?
How to retrieve error messages using odbc_errormsg()?