-
Aug 15th, 2022, 11:42 AM
#1
Thread Starter
New Member
Avaya CMS VB Scripting
Hello -
Wondering if someone can shed some light on how to pull the prior month via the VB Scripts, but the report is in a daily report; To and From date requirements. It has been a while since I have had to make this happen, but I do remember a code similar to the below that worked. Any ideas how I can make this happen?
Dim ThisMonth
Dim LastMonth
Dim Firstofmonth
Dim Lastofmonth
Dim DateBefore
ThisMonth = Date
LastMonth = DateAdd("m", -1, Date)
Firstofmonth = DateAdd("d", 1, Date - Day(Date))
Lastofmonth = DateAdd("m", 1, Date - Day(Date))
DateBefore = DateAdd("d", -1, Date)
Thanks,
Frank
-
Aug 15th, 2022, 03:41 PM
#2
Frenzied Member
Re: Avaya CMS VB Scripting
would be nice to see an example how you see avaya information file or otherwise - Its just that anumber of people have been talking about these recently.
Just thinking out loud
-
Aug 18th, 2022, 11:59 AM
#3
Re: Avaya CMS VB Scripting
Code:
Dim currentDate = Date
Dim lastMonth = DateAdd("m", -1, currentDate)
Dim firstLastMonth = DateSerial(Year(lastMonth), Month(lastMonth), 1)
Dim endLastMonth = DateAdd("d", -1, DateAdd("m", 1, firstLastMonth))
This:
1 - gets the current date
2 - subtracts one month from the current date
3 - gets the first of the previous month
4 - adds a month to step 3 (which ends up being the first of this month) then subtracts one day (to get the end of the previous month)
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|