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...

I want to display the employees who have joined in last two
months. (It should be executed randomly means If I execute
the query in March it should display Jan and Feb joined
employees. Same query if i execute in Feb, 2007 it should
display dec, 2006 and jan 2007 joined employees.

Answer Posted / balaji s.t

select convert(varchar(10),
dateadd(dd,-(day(dateadd(mm,1,getdate()))-1), dateadd(mm,-2,getdate())), 120),

convert(varchar(10),dateadd(dd,-(day(getdate())),getdate()),120)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is timestamp in mysql? : Sql dba

998


what is user defined functions? : Sql dba

973


What is delete command in sql?

1050


Why do we create views in sql?

1049


When is the update_statistics command used?

1045


Why do we need cursors in pl sql?

1000


Which tcp/ip port does sql server run on? How can it be changed? : Sql dba

924


What are the different ways to optimize a sql query?

888


How is a PL/SQL code compiled?

1167


What is %type in sql?

912


what is a trigger in mysql? : Sql dba

1065


Lookups are a key component in sql server integration services (ssis). Explain its purpose?

952


What is the use of non clustered index?

925


Is primary key is clustered index?

937


What is the command used to fetch the first 5 characters of a string?

1149