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

Explain acid?

604


Why we should not use triggers?

535


What is the difference between for auto and for nested?

506


How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?

561


What happens when converting big values to numeric data types?

565






What are the advantages of using stored procedures in sql server?

506


What is the difference between count and distinct count?

464


What is sub query and its properties?

543


Write a SQL query to delete a table?

649


what is denormalization and when would you go for it? : Sql server database administration

699


application server is slow what may be the problem

1780


Does sql server use java?

517


Explain foreign key in sql server?

577


How can we get count of the number of records in a table?

544


What is bookmark link in ssrs?

108