[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

Sql dates

Hi.
I want to find the date a year ago (- 365 days) based on the date today.
How do I do that?

kv
Oli
0
tolvudeild-VS
Asked:
tolvudeild-VS
1 Solution
 
momi_sabagCommented:
select current date - 1 year
from ....
0
 
maggiec58Commented:
You want to use year instead of 365 (leap year)
dateadd(yy,-1,getdate())
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now