CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Cambridge University, U.K.
    Posts
    10

    compare date in vb?



    Hi: there

    How can I compare date in vb?

    I only compare date not time, it's really trouble that I have to format

    long time to date, but I can't comare two string?


    any ideal?


    thanks


    George

  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: compare date in vb?



    Hi


    You want to take a look at the DateDiff function in VB. This can be used to give you the specified period between two dates (in either days, weeks, months, quarters, years, minutes, hours etc).


    This way you wont have to change your dates to strings to compare them. Obviously with the DateDiff function, if the result is '0' then both dates are identical.


    Regards


    Chris Eastwood


    CodeGuru - the website for developers

    http://www.codeguru.com



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

Featured