|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Need getDate() - 1 year
I need to have 2 fields in my rs, one being getDate(), and the other being getDate() - 1yr...see what I'm saying? Something like this...
Code:
CurrentDate CurrentDate_1Yrback ----------- ------------------ 2004-06-23 16:12:54.233 2003-06-23 16:12:54.233 ...have always neglected learning more about date features in SQL Server, now it's biting me in the rear Thx for any help. |
|
#2
|
|||
|
|||
|
Code:
select getdate() , dateadd(year,-1,getdate()) |
|
#3
|
|||
|
|||
|
right...was just gonna reply saying I got it...I was caught up trying to use the DatePart() and Date() functions, was getting into a mess though. Thx SB...much appreciated.
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Need getDate() - 1 year |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|