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
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 |
Answer / aravazhi
select month(getdate()) Curr_Mon,Year(getdate())
Curr_Year,day(getdate()) as Curr_day
| Is This Answer Correct ? | 3 Yes | 1 No |
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 |
what is extended StoreProcedure ?
what is difference between nchar and char in Sql server ?
What is the difference between IN and EXISTS operators in SQL Server?
9 Answers ASD Lab, CSC, Intelligroup,
explain what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration
How can you see what type of locks used?
Define self join in sql server joins?
what is the maximum size of sql row in mssql?
What is trigger in salesforce?
What is Trace flag?
How to create an index on an existing table in ms sql server?
What is the bookmark lookup and rid lookup?
What is use of except clause? How it differs from not in clause?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)