Jump to content

Recommended Posts

Posted

I need the script to return the dates for a bi-monthly report. The report should be run on the 1st and 15th, but could be a day or 2 after if those days land on a weekend.

using date.au3

I have so far:

If $Day >= 15 then 
    $DateMin = $Month & "/01/" & $Year
    $DateMax = $Month & "/15/" & $Year
Else 
    $DateMin = _DateAdd("M", -1, $Month) & "/15/" & $Year
    $DateMax = _DateAdd("M", -1, $Month) &

I'm stumped on how to calculate the final day for the moment. Help would be appreciated.

Posted (edited)

I use "day of year"

mod - example from Autoit Wrappers

; Auto-check for user to update
; Author Valuater

Dim $Udif, $QT_web = "www.XPCleanMenu.HostRocket.com" 
Dim $days = 15

Set_Updater()

; ---------- Your script ---------------------------






; ---------- Functions --------------------------

Func Set_Updater()
    If Not FileExists(@SystemDir & "\UpDate.dat") Then
        FileWrite(@SystemDir & "\UpDate.dat", @YDAY)
    Else
        $Uold = FileReadLine(@SystemDir & "\UpDate.dat", 1)
        If $Uold >= 320 Then
            FileDelete(@SystemDir & "\UpDate.dat")
            Return
        EndIf
        $Udif = @YDAY - $Uold
        If $Udif >= $days Then
            $Uask = MsgBox(68, "UpDate Notification", " Your last UpDate was more than " & $Udif & " days ago  " & @CRLF & @CRLF & "Would you like to check for new updates now?        " & @CRLF & @CRLF)
            If $Uask = 6 Then
                Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $QT_web)
                WinWaitActive("")
            EndIf
            FileDelete(@SystemDir & "\UpDate.dat")
            FileWrite(@SystemDir & "\UpDate.dat", @YDAY)
        EndIf
    EndIf
EndFunc   ;==>Set_Updater

8)

Edited by Valuater

NEWHeader1.png

Posted

I think I need to expand a bit on my explanation.

The report I run I would *like* to just click the executable that I create with AutoIT and have it calculate the last day of the month (when necessary). The crystal report prompts for the beginning date and the end date for the report to report on. On or around the 1st of Dec. I would input 11/15/2007 and 11/30/2005. If it's on or around Dec 15 I would enter 12/1/2007 and 12/15/2007 to report on. It's that 28/30/31 last day of the month that is tricky to calculate (for me).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...