Home All Groups Group Topic Archive Search About

Subtract Days from a Date

Author
14 Sep 2006 4:41 PM
Gabe Matteson
I want to be able to find out the names of files that have not been accessed
in the past X days...

i allow the user to put in the number of days, e.g. show all files that have
no been accessed in the past 30 days.

so i would do something like this:

dim lastaccessed as date
lastaccessed = date.today.subtract(txtnumberofdays.text)

is this possible?

Author
14 Sep 2006 5:14 PM
Cor Ligthert [MVP]
Gabe,

you mean something as simple as
Dim DateFourteenDaysAgo As DateTime = Now.AddDays(-CInt("14"))

I hope this helps,

Cor

Show quoteHide quote
"Gabe Matteson" <gmattesonATinqueryDOTbiz> schreef in bericht
news:OqWPHwB2GHA.4972@TK2MSFTNGP03.phx.gbl...

>I want to be able to find out the names of files that have not been
>accessed
> in the past X days...
>
> i allow the user to put in the number of days, e.g. show all files that
> have no been accessed in the past 30 days.
>
> so i would do something like this:
>
> dim lastaccessed as date
> lastaccessed = date.today.subtract(txtnumberofdays.text)
>
> is this possible?
>
Author
14 Sep 2006 5:53 PM
Gabe Matteson
YES! THANKS!

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:uPgXaEC2GHA.1268@TK2MSFTNGP02.phx.gbl...
> Gabe,
>
> you mean something as simple as
> Dim DateFourteenDaysAgo As DateTime = Now.AddDays(-CInt("14"))
>
> I hope this helps,
>
> Cor
>
> "Gabe Matteson" <gmattesonATinqueryDOTbiz> schreef in bericht
> news:OqWPHwB2GHA.4972@TK2MSFTNGP03.phx.gbl...
>
>>I want to be able to find out the names of files that have not been
>>accessed
>> in the past X days...
>>
>> i allow the user to put in the number of days, e.g. show all files that
>> have no been accessed in the past 30 days.
>>
>> so i would do something like this:
>>
>> dim lastaccessed as date
>> lastaccessed = date.today.subtract(txtnumberofdays.text)
>>
>> is this possible?
>>
>
>
Author
15 Sep 2006 1:28 PM
Phill W.
Cor Ligthert [MVP] wrote:

> you mean something as simple as
> Dim DateFourteenDaysAgo As DateTime = Now.AddDays(-CInt("14"))

Or even

Dim DateFourteenDaysAgo As DateTime = Now.AddDays(-14)

??

Regards,
    Phill  W.
Author
15 Sep 2006 6:13 PM
Cor Ligthert [MVP]
Phil,

I did that to show Gabe how to convert that textbox he was showing in his
sample.

You probably would not believe it, but I knew that what you showed.

:-)

But thanks for your contribution to this newsgroup.

And feel free to post another time, I often make mistakes.

Cor

Show quoteHide quote
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-k> schreef in bericht
news:eee9qd$8j2$1@south.jnrs.ja.net...
> Cor Ligthert [MVP] wrote:
>
>> you mean something as simple as
>> Dim DateFourteenDaysAgo As DateTime = Now.AddDays(-CInt("14"))
>
> Or even
>
> Dim DateFourteenDaysAgo As DateTime = Now.AddDays(-14)
>
> ??
>
> Regards,
>    Phill  W.