+ Reply to Thread
Results 1 to 3 of 3

Calculating the days with Format()

  1. #1
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Calculating the days with Format()

    Hi!

    What I'm tryn to do is calculate days that have passed from one date to another....it's simple but I'm haveing problems with it....
    This is my code:
    Please Login or Register  to view this content.
    It kind of says Overflow but if I put it a bit different I don't get the correct number of days.
    x.Value is a date in a range.

    Please help

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Calculating the days with Format()

    You could use this code:
    Please Login or Register  to view this content.
    I think that when you use Format instruction it transforms Date in string and then you can't do arithmetic operations with string, before you need to do the calculations and then apply the Format to the result
    Regards,
    Antonio
    Last edited by antoka05; 01-22-2013 at 04:17 AM.

  3. #3
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Calculating the days with Format()

    Quote Originally Posted by antoka05 View Post
    You could use this code:
    Please Login or Register  to view this content.
    So the first Format code didn't work correctly.
    But the second one works perfect!
    So thank you very much!

+ 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