How to get number of days in a given year?

Answers were Sorted based on User's Feedback



How to get number of days in a given year?..

Answer / sandhya

SELECT DATEDIFF(DD,HIREDATE,GETDATE())

Is This Answer Correct ?    1 Yes 0 No

How to get number of days in a given year?..

Answer / koppalahareesh

declare @y int;
set @y = 2016;

SELECT DATEDIFF(day,cast(@y as char(4)), cast(@y+1 as char(4))) Days

Is This Answer Correct ?    1 Yes 0 No

How to get number of days in a given year?..

Answer / dinesh rathod

would like to get the total number of days in a year left from the given

Is This Answer Correct ?    0 Yes 0 No

How to get number of days in a given year?..

Answer / pulak

select add_months(trunc(sysdate,'year'),12)-trunc(sysdate,'year') as days from dual;

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More SQL Server Interview Questions

What is trigger and different types of Triggers?

0 Answers   QuestPond,


Please explain what is “asynchronous” communication in sql server service broker?

0 Answers  


How can I create a plain-text flat file from SQL Server as input to another application?

2 Answers  


How to integrate the ssrs reports in application?

0 Answers  


Explain the relational database management system (rdbms)?

0 Answers  






What is sql server used for?

0 Answers  


what kind of lan types do you know? : Sql server database administration

0 Answers  


How many types of attribute relationships are there? : sql server analysis services, ssas

0 Answers  


Explain about nested stored procedure?

0 Answers  


What are the Pre Requisites when you apply Srvice Packs?

1 Answers   IBM,


You have a table ‘test’ which is a copy of northwind employee table you have written a trigger to update the field ‘hiredate’ with the current date

0 Answers  


How will you make an attribute not process? : sql server analysis services, ssas

0 Answers  


Categories