How to get number of days in a given year?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of joins in sql?

561


Can two tables share a primary key?

514


Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?

850


Can we run Reporting Services with SQL Server express edition, which is a free version of SQL Server?

78


What is the main purpose of having conversation group?

494






Using the customer, and order table in northwind database, please write a query to produce xml?

649


What is the default server name for sql server?

634


What is ssl in sql server?

546


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

616


List the different index configurations possible for a table?

512


explain what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration

642


What is sql server management studio? : sql server management studio

578


What is sql server transaction log file?

520


How does the report manager work in SSRS?

116


John exports information periodically from a microsoft sql server database to an oracle database what is the best way to do this?

527