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 |
How to create a view with data from multiple tables?
Can you create UNIQUE and PRIMARY KEY constraints on computed columns in SQL Server 2000?
How will you add a dimension to cube? : sql server analysis services, ssas
How do you check the performance of a query and how do you optimize it?
How are the unique and primary key constraints different?
How do I perform an unattended install of sql server 2000?
What do you do in data exploration
How do you debug a procedure in sql server?
What is amo? : sql server analysis services, ssas
how can u get last observation in an unknown dataset ?
Is it important for a database administrator to understand the operating system and file access?
How do you use a subquery to find records that exist in one table and do not exist in another?
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)