You can convert a TdateTime to TDate with
trunc(DateTimeValue). I don't think it will complain
about using a Tdatetime value in place of a date, but
if it does, use TDate(trunc(DateTimeValue)).  Also,
trunc(DateTimeValue2) - trunc(DateTimeValue1) will
give you the days between value since the date is
represented by the integer portion of that number.

   If this is some sort of disk cleanup operation, I
would think that you could use the file DateTimestamp
with DOS functions to accomplish that task more
easily. Use attrib.com to set/unset the archive flag
based on your dateTimeStamp criteria, then delete.com
to delete the files in a batch operation.

DJS

--- Curtis cloud <[EMAIL PROTECTED]> wrote:

> All, 
>  
> I am trying to calculate the diffence in two dates
> for example:
>  
> todays date and 07/16/2005 which should give me 5.
>  
> I attempted to use the daysbetween function but I
> believe it only works with two datetime values.
>  
> I have a file name test07/25/2005, I like to
> calculate the difference between the file and todays
> date and delete the file if the date is greater than
> 365 days. 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> [Non-text portions of this message have been
> removed]
> 
> 



                
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to