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 command used to check locks in microsoft sql server?

0 Answers  


What are the restraints imposed on the table design by a merge replication?

0 Answers  


What is a trace frag?

0 Answers  


What do you mean by an execution plan? Why is it used? How would you view it?

0 Answers  


can any one please send sql quries most used in applications.

2 Answers  






Explain the creation and execution of a user-defined function in the sql server?

0 Answers  


What are alternate keys?

0 Answers  


Does hive support indexing?

0 Answers  


What are logical/boolean operations in ms sql server?

0 Answers  


how many instance use in sql server 2005

4 Answers   EFI, HCL,


Suppose you want to implement the one-to-many relationships while designing tables. How would you do it?

0 Answers  


After the SQL installation what are the jobs will you configure?

1 Answers   G7 CR Technologies, IBM, Satyam,


Categories