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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is collation sensitivity? Explain different types.

547


Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?

579


How should i optimize the time for execution of stored procedure having single input and many output from the different tables?

1469


What is the difference between push and pull subscription? : sql server replication

613


What is the difference between writing data to mirrored drives versus raid5 drives

510






Why and when do stored procedure recompile?

546


How is SQL Azure different than SQL server?

91


Create a dts package to produce a text file using the ‘update statistics’ command for the tables in a database with obsolete statistics.

529


How to get the definition of a stored procedure back?

526


What is the use of “join” in sql server?

572


What is simple indexing method?

576


What is meant by indexing?

507


What are wait types?

588


What is deploy, process and build? : sql server analysis services, ssas

570


How to find Duplicate Records In table?

585