Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
reflex2dotnet
Yak Posting Veteran
99 Posts |
Posted - 2007-03-08 : 17:02:15
|
Hi allI am calculating the date difference between 2 dates as Dim t As DateTime Dim span As TimeSpan t = DateTime.Parse(Session("startDate")) Dim t2 As DateTime t2 = DateTime.Parse(Session("endDate")) span = t2 - tIf the span is 0, ies the start and endDate are same, i want to get the preivous date.Suppose both dates are today.. 3/8/2007i want to get 3/7/2007How can i do this?Any ideas?Thanks |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-03-08 : 17:12:00
|
You can use the .NET DateAdd function to do this. Just add -1 to the date.Tara Kizer |
|
|
reflex2dotnet
Yak Posting Veteran
99 Posts |
Posted - 2007-03-09 : 10:39:41
|
Thanks i got it worked |
|
|
|
|
|