Visual Basic 6 Date Comparison by Month
April 5, 2006 6:31 PM   Subscribe

Last Minute Visual Basic 6 Help!!! How do I compare a given date to today's date, based on a number of months?

I'm writing a tuition and billing program for my former high school, which is due tomorrow. The only part that's really making me unsure of my abilities is the part that generates bills. I've got it set up so the user can generate by date, student, and tuition plan. It's the date part that is throwing me for a loop.

What I'm looking for is some way to compare a date like so:
If Date = FirstPaymentDueDate + (one month) Then (do stuff)
If Date = FirstPaymentDueDate + (two months) Then (do stuff)
etc.
(where FirstPaymentDueDate is a pre-existing variable of type Date)

Is there some easy way to do this (that is, fill in the code for "one month" and "two months")? Or do I have to use some sort of brutal string manipulation?

Thanks!
posted by fvox13 to Computers & Internet (3 answers total)
 
Best answer: You probably want the DateAdd function.

Doesn't anyone read the docs anymore?
posted by sbutler at 6:59 PM on April 5, 2006


Response by poster: Thanks guys (girls?). I'm still relatively new at VB, so pretty much everything I do starts with a lot of google searches. When those fail, I turn to expert assistance!
posted by fvox13 at 7:23 PM on April 5, 2006


Best answer: If you're getting into VB6, a good reference for the built-in functions is the O'Reilly book VB and VBA in a Nutshell. Much better than the help files, in my opinion.
posted by SteveInMaine at 5:55 AM on April 6, 2006


« Older where do i get alpha testers for my site   |   Why does my neighbor have so many guests? Newer »
This thread is closed to new comments.