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 are extended events in sql server?

0 Answers  


What is sql server agent and what are the two modes of authentication in sql server?

0 Answers  


What is a with(nolock)?

0 Answers  


1.what is the difference between view and cursor? 2.If we do any change in view will it affect the database,similarly when we do changes in cursor will it affect the databse?with certain example?Thanks

5 Answers  


Explain transaction server explicit transaction?

0 Answers  






What is the datatype returned by count(*)

22 Answers   247Customer, Asian CERC,


What are the advantages of sql stored procedure?

0 Answers  


What are the common performance issues in sql server?

0 Answers  


can an automatic recovery be initiated by a user? : Sql server administration

0 Answers  


What is a self join in sql server?

0 Answers  


What is the use of keyword with encryption. Create a store procedure with encryption?

0 Answers  


How to declare a cursor with "declare ... Cursor" in ms sql server?

0 Answers  


Categories