troubleshooting Question

Rolling Qtrs using vb6 classic

Avatar of rjef
rjefFlag for United States of America asked on
Visual Basic Classic
27 Comments1 Solution15 ViewsLast Modified:
I need to change the below logic to take into consideration what quarter the current date is
here is the logic i need
MonthTime frame to keepMonths
Jan 2021Apr 2020 to Jan 202110
Feb 2021Apr 2020 to Feb 202111
Mar 2021Apr 2020 to Mar 202112
Apr 2021Jul 2020 to Apr 202110
May 2021Jul 2020 to May 202111
Jun 2021Jul 2020 to Jun 202112
Jul 2021Oct 2020 to Jul 202110
Aug 2021Oct 2020 to Aug 202111
Sep 2021Oct 2020 to Sep 202112
Oct 2021Jan 2021 to Oct 202110
Nov 2021Jan 2021 to Nov 202111
Dec 2021Jan 2021 to Dec 2021 12

 the below is just by months and needs to be by quarters with the above table as reference

' lvmain1  date is mmddyyyy  ie 01202020
For zzz = LVMain1.ListItems.Count To 1 Step -1
    DDate = LVMain1.ListItems(zzz).SubItems(10)
    CDDate = Left(DDate, 2) & "-" & Mid(DDate, 3, 2) & "-" & Right(DDate, 4)
    If (Year(Now) * 12 + Month(Now)) - (Year(CDDate) * 12 + Month(CDDate)) > 11 Then
        LVMain1.ListItems.Remove (zzz)
    End If
Next zzz
Join our community to see this answer!
Unlock 1 Answer and 27 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 27 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros