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 / sandip

//Show records for a given month
SELECT * FROM table_name (NOLOCK)
WHERE SUBSTRING(res_date, 6, 2) = (numeric value for month.
eg 01 for Jan)


//Show all the records sorted by res_date based on month.
SELECT * FROM table_name (NOLOCK)
ORDER BY SUBSTRING(res_date, 6, 2) ASC

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a join in sql?

1093


How do I port a number to sql server?

1039


What is the difference between the export /import functions in sql studio and standalone sql manager? : sql server management studio

1143


What is the difference between DataRow.Delete() and DataRow.Remove()?

1230


Tell me about normalization in DBMS.

995


what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration

1039


What are the new data types are introduced in sql 2000?

907


What is default constraint?

1000


Is oracle faster than sql server?

954


How to execute the cursor queries with "open" statements?

1180


what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration

909


What you can do to delete a table without the delete trigger firing?

973


Explain how to use linked server?

992


What is the function of inner join?

1074


How would you choose between a clustered and a non-clustered index?

977