+ Reply to Thread
Results 1 to 4 of 4

Put only date (not time too) in variable from FileDateTime function

  1. #1
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253

    Put only date (not time too) in variable from FileDateTime function

    What would be the syntx for the variable, dtFileDate to contain only the date (not the time) from the FileDateTime function? For example put 1/21/2006 in the variable dtFileDate when FileDateTime is 1/21/2006 11:57:16 AM?

    In other words, from:
    dtFileDate = FileDateTime("C:\USR\MIKE\AT0158.MB")

    I need dtFileDate to contain only the date 1/21/2006 (not the time 11:57:16 AM, too).

    Thanks so very much. mikeburg

  2. #2
    Bob Phillips
    Guest

    Re: Put only date (not time too) in variable from FileDateTime function

    dtFileDate = Int(FileDateTime("C:\USR\MIKE\AT0158.MB"))

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "mikeburg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > What would be the syntx for the variable, dtFileDate to contain only the
    > date (not the time) from the FileDateTime function? For example put
    > 1/21/2006 in the variable dtFileDate when FileDateTime is 1/21/2006
    > 11:57:16 AM?
    >
    > In other words, from:
    > dtFileDate = FileDateTime("C:\USR\MIKE\AT0158.MB")
    >
    > I need dtFileDate to contain only the date 1/21/2006 (not the time
    > 11:57:16 AM, too).
    >
    > Thanks so very much. mikeburg
    >
    >
    > --
    > mikeburg
    > ------------------------------------------------------------------------
    > mikeburg's Profile:

    http://www.excelforum.com/member.php...o&userid=24581
    > View this thread: http://www.excelforum.com/showthread...hreadid=503681
    >




  3. #3
    Gary Keramidas
    Guest

    Re: Put only date (not time too) in variable from FileDateTime function

    i've always just used format

    Format(FileDateTime("C:\USR\MIKE\AT0158.MB"), "mm/dd/yy")

    --


    Gary


    "mikeburg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > What would be the syntx for the variable, dtFileDate to contain only the
    > date (not the time) from the FileDateTime function? For example put
    > 1/21/2006 in the variable dtFileDate when FileDateTime is 1/21/2006
    > 11:57:16 AM?
    >
    > In other words, from:
    > dtFileDate = FileDateTime("C:\USR\MIKE\AT0158.MB")
    >
    > I need dtFileDate to contain only the date 1/21/2006 (not the time
    > 11:57:16 AM, too).
    >
    > Thanks so very much. mikeburg
    >
    >
    > --
    > mikeburg
    > ------------------------------------------------------------------------
    > mikeburg's Profile:
    > http://www.excelforum.com/member.php...o&userid=24581
    > View this thread: http://www.excelforum.com/showthread...hreadid=503681
    >




  4. #4
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253
    Thanks again, guys. If it were not for y'all, people like me would probably give up trying to learn VBA. mikeburg

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1