Search Results

Search found 2 results on 1 pages for 'mlevit'.

Page 1/1 | 1 

  • Write to file using CopyHere without using WScript.Sleep

    - by mlevit
    Hi guys, I've written a small VBScript to creates a .zip file and then copies the contents of a specified folder into that .zip file. I copy the files over one by one for a reason (I know I can do the whole lot at once). However my problem is when I try to copy them one by one without a WScript.Sleep between each loop iteration I get a "File not found or no read permission." error; if I place a WScript.Sleep 200 after each write it works but not 100% of the time. Pretty much I'd like to get rid of the Sleep function and not rely on that because depending on the file size it may take longer to write therefore 200 milliseconds may not be enough etc. As you can see with the small piece of code below, I loop through the files, then if they match the extension I place them into the .zip (zipFile) For Each file In folderToZip.Items For Each extension In fileExtensions if (InStr(file, extension)) Then zipFile.CopyHere(file) WScript.Sleep 200 Exit For End If Next Next Any suggestions on how I can stop relying on the Sleep function? Thanks

    Read the article

  • SQL query to retrieve financial year data grouped by the year

    - by mlevit
    Hi, I have a database with lets assume two columns (service_date & invoice_amount). I would like to create an SQL query that would retrieve and group the data for each financial year (July to June). I have two years of data so that is two financial years (i.e. 2 results). I know I can do this manually by creating an SQL query to group by month then run the data through PHP to create the financial year data but I'd rather have an SQL query. All ideas welcome. Thanks

    Read the article

1