Query to add years to particular date
select dateadd(year,noofyears to be added,datecolumndate)yearadd from tablename
Query to add years to particular date
Query to add years to particular date
select dateadd(year,noofyears to be added,datecolumndate)yearadd from tablename
select dateadd(year,noofyears to be added,datecolumndate)yearadd from tablename
Query to add months to particular date
Query to add months to particular date
select dateadd(month,noofmonths to be added,datecolumndate)monthadd from tablename
select dateadd(month,noofmonths to be added,datecolumndate)monthadd from tablename
Query to add days to particular date
Query to add days to particular date
select dateadd(day,noofdays to be added,datecolumnname)dayadd from tablename
select dateadd(day,noofdays to be added,datecolumnname)dayadd from tablename
Query to get only year from particular date
Query to get only year from particular date
select year(datecolumnname)as year from tablename
select year(datecolumnname)as year from tablename
Query to get only month from particular date
Query to get only month from particular date
select month(datecolumnname)as month from tablename
select month(datecolumnname)as month from tablename
Query to get only day from particualar date
Query to get only day from particualar date
select day(datecolumnname)as day from tablename
select day(datecolumnname)as day from tablename
Query to get only date from datetime field
Query to get only date from datetime field
select convert(varchar,datecolumnname,110) from tablename
select convert(varchar,datecolumnname,110) from tablename
Subscribe to:
Posts (Atom)