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 are the kinds of subquery?

0 Answers  


What is an example of a foreign key?

0 Answers  


can we call stored Procedure in Function in Sql Server 2000 and vice versa.

3 Answers   C3I, eSoft, iPRO Solutions, Wipro,


How do I know if localdb is running?

0 Answers  


there is a trigger defined for insert operations on a table, in an oltp system. The trigger is written to instantiate a com object and pass the newly inserted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? : Sql server database administration

0 Answers  






Please give me queries for the following 1. To get the count of duplicate records. 2. A query to delete the duplicate records.

3 Answers   247Customer,


What is the benefit of normalization?

0 Answers  


you accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover? : Sql server administration

0 Answers  


What are the properties and different types of sub-queries?

0 Answers  


what is diffrent between store procedure and trigger

2 Answers  


If i am handling 150 servers then how to check the active jobs of all the servers?

0 Answers  


How to get the query of a table in sql server?

0 Answers  


Categories