Adddate Sql Code Example


Example: sql server current date minus 5 years

SELECT GETDATE() 'Today',             DATEADD(day,-2,GETDATE()) 'Today - 2 Days' SELECT GETDATE() 'Today',             DATEADD(dd,-2,GETDATE()) 'Today - 2 Days' SELECT GETDATE() 'Today',             DATEADD(d,-2,GETDATE()) 'Today - 2 Days'

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable