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 the difference between TRUNCATE and DROP?

1064


Do you know what are the differences between lost updates and uncommitted dependencies?

1008


What are the requirements to use odbc connections in php scripts?

1058


Explain transaction server consistency?

921


What is the guest user account in sql server? What login is it mapped to it? : sql server security

1006


How do we Backup SQL Azure Data?

106


How to how to convert numeric expression data types using the convert() function??

989


what are the important architecture components of SSRS?

124


How is table type constraint applied to a table?

933


What does it mean to invest in the index?

905


What is the difference between a clustered index and a non-clustered index?

924


Hi all, can any one please tell me the difference between sql server 2008 and orace 9i

1901


What is table-valued sub query?

921


1.what is the diff between nolock optimizer and read uncommitted isolation? 2.what is the diff between revoke and deny? 3.what is percieved down time? 4.whether password protection are required for backups?if yes why?if no why? 5.what is fill factor? 6.what is cost analysis? 7.what is mean by piece meal restore? 8.what is 'rowguidcol'? 9.impersonate permission? 10.what is selectivity?

2029


What is the use of for clause?

1034