By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,887 Members | 1,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,887 IT Pros & Developers. It's quick & easy.

need help on DateDiff function!

P: n/a
Hi ,
I am trying to use DateDiff to get the date after subtracting 60
days from today.

Please help
thanks
-L

Feb 16 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Learner,

I think you need to use DateAdd, not DateDiff:

DateAdd(DateInterval.Day, -60, Now)

Kerry Moorman
"Learner" wrote:
Hi ,
I am trying to use DateDiff to get the date after subtracting 60
days from today.

Please help
thanks
-L

Feb 16 '06 #2

P: n/a
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim da As Date = Today

da = da.AddDays(-60)

MsgBox("60 days ago is " & da)

End Sub

Perhaps this will help.

Joe

"Learner" <pr****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi ,
I am trying to use DateDiff to get the date after subtracting 60
days from today.

Please help
thanks
-L

Feb 16 '06 #3

P: n/a
Yes that works. Thanks for the help. Also, i am just wondering if you
could help with me how do i handle windows file management in vb.net? i
would use FileManagementSystem in classic or vb script. Is there an
article to go about it . Because i am moving Directories and
subdirectories and files to a different location and also need to crete
folders and subdirectories on the fly if it doesn't find them.

I am trying with Imports System.IO but any code snippet to manage the
folders and files?
Thanks
-L

Feb 16 '06 #4

P: n/a
You might find something useful here.

http://www.codeproject.com/vb/net/WhidbeyFileMgmnt.asp

Joe
--

"Learner" <pr****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Yes that works. Thanks for the help. Also, i am just wondering if you
could help with me how do i handle windows file management in vb.net? i
would use FileManagementSystem in classic or vb script. Is there an
article to go about it . Because i am moving Directories and
subdirectories and files to a different location and also need to crete
folders and subdirectories on the fly if it doesn't find them.

I am trying with Imports System.IO but any code snippet to manage the
folders and files?
Thanks
-L

Feb 16 '06 #5

P: n/a
With My.Computer.FileSystem

..CreateDirectory("C:\Test")

..CopyDirectory("C:\Test", "C:\Test1")

MsgBox(.DirectoryExists("C:\JoeSu"))

'there are plenty more methods and properties for file management

End With
Hopefully, you're using 2005 ...

Joe
--

"Learner" <pr****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Yes that works. Thanks for the help. Also, i am just wondering if you
could help with me how do i handle windows file management in vb.net? i
would use FileManagementSystem in classic or vb script. Is there an
article to go about it . Because i am moving Directories and
subdirectories and files to a different location and also need to crete
folders and subdirectories on the fly if it doesn't find them.

I am trying with Imports System.IO but any code snippet to manage the
folders and files?
Thanks
-L

Feb 16 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.