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


hi, may i know what is the command to get abstract the
current month, current year and current day from a given
date.i want these three in a isolated way..seperatedly is
that any way in sql server 2000

Answers were Sorted based on User's Feedback



hi, may i know what is the command to get abstract the current month, current year and current day ..

Answer / madhu

We can get date, month and year seperately from the
current date like

select DATEPART(d, getdate()) to get current date
select DATEPART(mm, getdate()) to get current month
select DATEPART(yy, getdate()) to get current year

Is This Answer Correct ?    7 Yes 0 No

hi, may i know what is the command to get abstract the current month, current year and current day ..

Answer / aravazhi

select month(getdate()) Curr_Mon,Year(getdate())
Curr_Year,day(getdate()) as Curr_day

Is This Answer Correct ?    3 Yes 1 No

hi, may i know what is the command to get abstract the current month, current year and current day ..

Answer / dharmendra k. dixit

We can do that by writing our query in this way..

Select datename(dd, getdate()) for Date
Select datename(mm, getdate()) for Month
Select datename(yy, getdate()) for Year

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More SQL Server Interview Questions

What is the difference between login and a user?

13 Answers   CTS, TCS,


Tell me what is the order in which the sql query is executed?

0 Answers  


Define views.

0 Answers  


logshipping is Any difference 2000 and 2005?

2 Answers  


How do you create type- insensitive operator?

0 Answers   EXL,


If a table does not have a unique index, can a cursor be opened on it?

0 Answers  


Creating Tables Using SELECT

1 Answers  


What is the Disadvantage of indexed sequential file.

0 Answers   HCL,


Difference between writing SQL query and stored procedure ?

15 Answers   Cognizant, Infosys, TCS, Veritas,


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

0 Answers   TCS,


How to select all columns of all rows from a table with a select statement in ms sql server?

0 Answers  


What is sub-query in sql server?

0 Answers  


Categories