Results 1 to 3 of 3

Thread: DataDiff

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73
    Hello I am trying to find the number of days in between 2 dates and when I use the following code it does not work right all the time. The problem I believe is when I subtract dates from 2 different YEARS. Does anyone have any suggestions on this....

    txt1.text = DateDiff("d", txt2.text, Date)

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124
    Does txt2.Text need to be converted to a date variable or is it not formatted properly? It seemed to work all right for me in VB6.

  3. #3
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Examples

    Hi VBAmateur,

    I'm with bsmith, I ran it on VB6 without any problems. It will be a lot easier to help you if you provide example dates that are giving you trouble.

    All the best.

Posting Permissions

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



Click Here to Expand Forum to Full Width