Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to verify the port number of the sql server?

1256


What is user-defined functions? What are the types of user-defined functions that can be created?

1085


What the different components of Replication and what is their use?

1128


What are key constraints?

1018


Tell me what are cursors and when they are useful?

994


Explain powershell included in sql server 2008?

1117


How will you optimize a stored procedure optimization?

1116


What is the osql utility?

1039


Does group by or order by come first?

1001


Mention what are the core components of ssrs?

330


Define primary key?

1200


How to automatically create a log when an exception is being received into SQL Server?

1361


What is report snapshot?

163


List out some of the requirements to set up a sql server failover cluster?

1081


What are the different types of sub-queries?

1091