Asp.Net

Monday, 16 September 2013

Date Difference in SQL Server

SQL SERVER:
use task
create table date
(Startdate date,
Enddate date)
insert into date values('2013-01-01',GETDATE())

select * from date
select *,DATEDIFF(MONTH,Startdate,Enddate) as diffdate from date

No comments:

Post a Comment