Hi Li Pang,
You can use the following code:
Dim oTimeSpan As New System.TimeSpan(1,0,0,0)
Dim oDate As System.DateTime = System.DateTime.Now.Substract(oTimeSpan)
and oDate should contain yesterdays date...
Greetings,
Juan Pedro Gonzalez
"Li Pang" <Li****@discussions.microsoft.com> escribió en el mensaje
news:96**********************************@microsof t.com...
Hi,
In VB6 I used Now() -1 to get yesterday, but it's not allowed in vb.NET.
Is there a similar way to do it in vb.Net?
Thanks in advance