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 (4 comments total)
If Date(Day(Now()), Month(Now()), Year(Now())) = Date(Day(Now()), Month(Now()) + 1, Year(Now())) Then
It might be DateSerial(,,,) that I'm thinking about. You'll also have to do some hoop-jumping for the year-end stuff.
posted by odinsdream at 6:38 PM on April 5, 2006