Results 1 to 3 of 3

Thread: Avaya CMS VB Scripting

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2022
    Posts
    1

    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

  2. #2
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    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

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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