# Date Difference

## Recommended Posts

This is an easy way to get the number of days between today and any future date without having to acount for Hours, Minutes, and Seconds.

#include <Date.au3>

Func ShowDays(\$FutureDate)
\$iDaysDiff = _DateDiff('D', _NowCalcDate(), \$FutureDate)
If \$iDaysDiff < 1 Then Return 0 ;Insure only positive return
Return \$iDaysDiff
EndFunc ;==GoPR

MsgBox(0, '',  ShowDays("2017/07/31"))

I use it to know how many days till I go on my next vacation.

Maybe one of you can find a use for it.

## Create an account

Register a new account

• ### Similar Content

• I forgot an important and needed aspect of my code. I need to be able to check for people who work every other week. Is it possible to write the dates that they work (every other week) between two date ranges?
Example:  Bob Smith has a Start date of 8-26-2018 (that is the date he is hired) And He stops working on 12-12-18 (that's the day he goes on vacation or whatever) However his work shift is every other Saturday from 7:30 AM to 6:00 Pm.  I need to calculate every other Saturday between 8-26-18 and 12-12-18 (is this clear?)

here is the code I have so far. I am just missing this last part:
; Step 7 Func SendData() ;******************************************************************************* ; Sends all collected data to the Excel file in correct order for Upload ;******************************************************************************* MsgBox(\$MB_ICONINFORMATION, "Scheduler_Bot", "Sending Data", 2) ; Loop Counters \$LoopCount = 0 \$Array_Index = 0 \$DayIndex = 0 \$dataIndex = 0 ; Counter for the day of the week Local \$dCount = 2 ; Counter for the numbers of Ys Local \$yesCount = 0 ; Excel Write Counter (VERY IMPORTANT!) Local \$EWriteCount = 2 ; Declare the global shift arrays (Sunday - Saturday) Global \$ShiftDaySU[100][600] Global \$ShiftDayM[100][600] Global \$ShiftDayT[100][600] Global \$ShiftDayW[100][600] Global \$ShiftDayR[100][600] Global \$ShiftDayF[100][600] Global \$ShiftDayS[100][600] Global \$sDates[400] While \$Formatted_Names[\$dataIndex] <> \$Formatted_Names[\$IndexRows] ; \$LoopCount < \$IndexRows \$ACounter = 0 ; Array counter ; Gets the Start date from the array \$Temp = \$StartDate[\$Array_Index] \$TempStart = StringLeft(\$Temp, 8) \$StartTempYear = StringLeft(\$TempStart, 4) \$StartTempMonth = StringMid(\$TempStart, 5, 2) \$StartTempDay = StringRight(\$TempStart, 2) ; Gets the End date from the array \$Temp = \$EndDate[\$Array_Index] \$TempEnd = StringLeft(\$Temp, 8) \$EndTempYear = StringLeft(\$TempEnd, 4) \$EndTempMonth = StringMid(\$TempEnd, 5, 2) \$EndTempDay = StringRight(\$TempEnd, 2) ; The starting date (in value form) \$sdate = _DateToDayValue(\$StartTempYear, \$StartTempMonth, \$StartTempDay) ;_DateToDayValue(2019,1,9) ;ConsoleWrite(@CRLF & "\$start date " & \$sdate & @CRLF & @CRLF) ; The ending date (in value form) \$edate = _DateToDayValue(\$EndTempYear, \$EndTempMonth, \$EndTempDay) ;_DateToDayValue(2019,4,9) ;ConsoleWrite(@CRLF & "\$end date " & \$edate & @CRLF & @CRLF) ; Variables for readability Local \$iYear, \$iMonth, \$iDay ;Stores what day of the week that shift lands on Local \$tSU = _Excel_RangeRead(\$OpenWorkbook, Default, "I" & \$dCount) If \$tSU = "Y" Then \$yesCount = 1 EndIf Local \$tM = _Excel_RangeRead(\$OpenWorkbook, Default, "J" & \$dCount) If \$tM = "Y" Then \$yesCount += 1 EndIf Local \$tT = _Excel_RangeRead(\$OpenWorkbook, Default, "K" & \$dCount) If \$tT = "Y" Then \$yesCount += 1 EndIf Local \$tW = _Excel_RangeRead(\$OpenWorkbook, Default, "L" & \$dCount) If \$tW = "Y" Then \$yesCount += 1 EndIf Local \$tR = _Excel_RangeRead(\$OpenWorkbook, Default, "M" & \$dCount) If \$tR = "Y" Then \$yesCount += 1 EndIf Local \$tF = _Excel_RangeRead(\$OpenWorkbook, Default, "N" & \$dCount) If \$tF = "Y" Then \$yesCount += 1 EndIf Local \$tS = _Excel_RangeRead(\$OpenWorkbook, Default, "O" & \$dCount) If \$tS = "Y" Then \$yesCount += 1 EndIf ConsoleWrite(@CRLF & @CRLF) ConsoleWrite(\$tSU & @CRLF) ConsoleWrite(\$tM & @CRLF) ConsoleWrite(\$tT & @CRLF) ConsoleWrite(\$tW & @CRLF) ConsoleWrite(\$tR & @CRLF) ConsoleWrite(\$tF & @CRLF) ConsoleWrite(\$tS & @CRLF) ConsoleWrite(@CRLF & @CRLF) ; Check to see if they work every other week Local \$rotationWeek = _Excel_RangeRead(\$OpenWorkbook, Default, "U" & \$dCount) If \$rotationWeek = "0" Then ; Do nothing Else If \$rotationWeek = 1 ; Do something Else ; \$rotationWeek = 2 ; Do something EndIf EndIf Local \$repeatWeek = _Excel_RangeRead(\$OpenWorkbook, Default, "V" & \$dCount) If \$rotationWeek = "0" Then ; Do nothing Else If \$rotationWeek = 1 ; Do something Else ; \$rotationWeek = 2 ; Do something EndIf EndIf While \$yesCount > 0 If \$tSU = "Y" Then For \$Index = \$sdate To \$edate _DayValueToDate(\$Index, \$iYear, \$iMonth, \$iDay) ; Finds the day based on its numerical value (1 = Sunday) If _DateToDayOfWeek(\$iYear, \$iMonth, \$iDay) = 1 Then \$Temp = \$iYear & "-" & \$iMonth & "-" & \$iDay & "T" & "00" & ":" & "00" & ":" & "00" & ":" & "000" \$ShiftDaySU[\$ACounter][\$DayIndex] = \$Temp _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$ShiftDaySU[\$ACounter][\$DayIndex], "AI" & \$EWriteCount) ; Send Name _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Formatted_Names[\$dataIndex], "AA" & \$EWriteCount) ; Send Start Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$StartTimes[\$dataIndex], "AB" & \$EWriteCount) ; Send End Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$EndTimes[\$dataIndex], "AC" & \$EWriteCount) ; Send Work Hours _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$HoursWorked[\$dataIndex], "AD" & \$EWriteCount) ; Send Work Group _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkGroup[\$dataIndex], "AE" & \$EWriteCount) ; Send Department _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkDepartment, "AF" & \$EWriteCount) ; Send Supervisor _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Supervisors[\$dataIndex], "AG" & \$EWriteCount) ; Send Notes _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkNotes[\$dataIndex], "AH" & \$EWriteCount) ; Send Shift Number \$tempStime = StringReplace(\$StartTimes[\$dataIndex], ":", "") \$tempEtime = StringReplace(\$EndTimes[\$dataIndex], ":", "") _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, "SU " & \$tempStime & "-" & \$tempEtime, "AJ" & \$EWriteCount) \$ACounter += 1 \$EWriteCount += 1 ConsoleWrite(@CRLF & "Sunday " & \$Temp & @CRLF) EndIf Next \$yesCount -= 1 \$tSU = "N" ElseIf \$tM = "Y" Then For \$Index = \$sdate To \$edate _DayValueToDate(\$Index, \$iYear, \$iMonth, \$iDay) ; Finds the day based on its numerical value (1 = Sunday) If _DateToDayOfWeek(\$iYear, \$iMonth, \$iDay) = 2 Then \$Temp = \$iYear & "-" & \$iMonth & "-" & \$iDay & "T" & "00" & ":" & "00" & ":" & "00" & ":" & "000" \$ShiftDayM[\$ACounter][\$DayIndex] = \$Temp _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$ShiftDayM[\$ACounter][\$DayIndex], "AI" & \$EWriteCount) ; Send Name _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Formatted_Names[\$dataIndex], "AA" & \$EWriteCount) ; Send Start Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$StartTimes[\$dataIndex], "AB" & \$EWriteCount) ; Send End Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$EndTimes[\$dataIndex], "AC" & \$EWriteCount) ; Send Work Hours _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$HoursWorked[\$dataIndex], "AD" & \$EWriteCount) ; Send Work Group _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkGroup[\$dataIndex], "AE" & \$EWriteCount) ; Send Department _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkDepartment, "AF" & \$EWriteCount) ; Send Supervisor _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Supervisors[\$dataIndex], "AG" & \$EWriteCount) ; Send Notes _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkNotes[\$dataIndex], "AH" & \$EWriteCount) ; Send Shift Number \$tempStime = StringReplace(\$StartTimes[\$dataIndex], ":", "") \$tempEtime = StringReplace(\$EndTimes[\$dataIndex], ":", "") _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, "M " & \$tempStime & "-" & \$tempEtime, "AJ" & \$EWriteCount) \$ACounter += 1 \$EWriteCount += 1 ConsoleWrite(@CRLF & "Monday " & \$Temp & @CRLF) EndIf Next \$yesCount -= 1 \$tM = "N" ElseIf \$tT = "Y" Then For \$Index = \$sdate To \$edate _DayValueToDate(\$Index, \$iYear, \$iMonth, \$iDay) ; Finds the day based on its numerical value (1 = Sunday) If _DateToDayOfWeek(\$iYear, \$iMonth, \$iDay) = 3 Then \$Temp = \$iYear & "-" & \$iMonth & "-" & \$iDay & "T" & "00" & ":" & "00" & ":" & "00" & ":" & "000" \$ShiftDayT[\$ACounter][\$DayIndex] = \$Temp _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$ShiftDayT[\$ACounter][\$DayIndex], "AI" & \$EWriteCount) ; Send Name _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Formatted_Names[\$dataIndex], "AA" & \$EWriteCount) ; Send Start Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$StartTimes[\$dataIndex], "AB" & \$EWriteCount) ; Send End Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$EndTimes[\$dataIndex], "AC" & \$EWriteCount) ; Send Work Hours _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$HoursWorked[\$dataIndex], "AD" & \$EWriteCount) ; Send Work Group _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkGroup[\$dataIndex], "AE" & \$EWriteCount) ; Send Department _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkDepartment, "AF" & \$EWriteCount) ; Send Supervisor _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Supervisors[\$dataIndex], "AG" & \$EWriteCount) ; Send Notes _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkNotes[\$dataIndex], "AH" & \$EWriteCount) ; Send Shift Number \$tempStime = StringReplace(\$StartTimes[\$dataIndex], ":", "") \$tempEtime = StringReplace(\$EndTimes[\$dataIndex], ":", "") _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, "T " & \$tempStime & "-" & \$tempEtime, "AJ" & \$EWriteCount) \$ACounter += 1 \$EWriteCount += 1 ConsoleWrite(@CRLF & "Tuesday " & \$Temp & @CRLF) EndIf Next \$yesCount -= 1 \$tT = "N" ElseIf \$tW = "Y" Then For \$Index = \$sdate To \$edate _DayValueToDate(\$Index, \$iYear, \$iMonth, \$iDay) ; Finds the day based on its numerical value (1 = Sunday) If _DateToDayOfWeek(\$iYear, \$iMonth, \$iDay) = 4 Then \$Temp = \$iYear & "-" & \$iMonth & "-" & \$iDay & "T" & "00" & ":" & "00" & ":" & "00" & ":" & "000" \$ShiftDayW[\$ACounter][\$DayIndex] = \$Temp _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$ShiftDayW[\$ACounter][\$DayIndex], "AI" & \$EWriteCount) ; Send Name _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Formatted_Names[\$dataIndex], "AA" & \$EWriteCount) ; Send Start Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$StartTimes[\$dataIndex], "AB" & \$EWriteCount) ; Send End Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$EndTimes[\$dataIndex], "AC" & \$EWriteCount) ; Send Work Hours _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$HoursWorked[\$dataIndex], "AD" & \$EWriteCount) ; Send Work Group _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkGroup[\$dataIndex], "AE" & \$EWriteCount) ; Send Department _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkDepartment, "AF" & \$EWriteCount) ; Send Supervisor _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Supervisors[\$dataIndex], "AG" & \$EWriteCount) ; Send Notes _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkNotes[\$dataIndex], "AH" & \$EWriteCount) ; Send Shift Number \$tempStime = StringReplace(\$StartTimes[\$dataIndex], ":", "") \$tempEtime = StringReplace(\$EndTimes[\$dataIndex], ":", "") _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, "W " & \$tempStime & "-" & \$tempEtime, "AJ" & \$EWriteCount) \$ACounter += 1 \$EWriteCount += 1 ConsoleWrite(@CRLF & "Wednesday " & \$Temp & @CRLF) EndIf Next \$yesCount -= 1 \$tW = "N" ElseIf \$tR = "Y" Then For \$Index = \$sdate To \$edate _DayValueToDate(\$Index, \$iYear, \$iMonth, \$iDay) ; Finds the day based on its numerical value (1 = Sunday) If _DateToDayOfWeek(\$iYear, \$iMonth, \$iDay) = 5 Then \$Temp = \$iYear & "-" & \$iMonth & "-" & \$iDay & "T" & "00" & ":" & "00" & ":" & "00" & ":" & "000" \$ShiftDayR[\$ACounter][\$DayIndex] = \$Temp _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$ShiftDayR[\$ACounter][\$DayIndex], "AI" & \$EWriteCount) ; Send Name _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Formatted_Names[\$dataIndex], "AA" & \$EWriteCount) ; Send Start Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$StartTimes[\$dataIndex], "AB" & \$EWriteCount) ; Send End Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$EndTimes[\$dataIndex], "AC" & \$EWriteCount) ; Send Work Hours _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$HoursWorked[\$dataIndex], "AD" & \$EWriteCount) ; Send Work Group _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkGroup[\$dataIndex], "AE" & \$EWriteCount) ; Send Department _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkDepartment, "AF" & \$EWriteCount) ; Send Supervisor _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Supervisors[\$dataIndex], "AG" & \$EWriteCount) ; Send Notes _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkNotes[\$dataIndex], "AH" & \$EWriteCount) ; Send Shift Number \$tempStime = StringReplace(\$StartTimes[\$dataIndex], ":", "") \$tempEtime = StringReplace(\$EndTimes[\$dataIndex], ":", "") _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, "R " & \$tempStime & "-" & \$tempEtime, "AJ" & \$EWriteCount) \$ACounter += 1 \$EWriteCount += 1 ConsoleWrite(@CRLF & "Thursday " & \$Temp & @CRLF) EndIf Next \$yesCount -= 1 \$tR = "N" ElseIf \$tF = "Y" Then For \$Index = \$sdate To \$edate _DayValueToDate(\$Index, \$iYear, \$iMonth, \$iDay) ; Finds the day based on its numerical value (1 = Sunday) If _DateToDayOfWeek(\$iYear, \$iMonth, \$iDay) = 6 Then \$Temp = \$iYear & "-" & \$iMonth & "-" & \$iDay & "T" & "00" & ":" & "00" & ":" & "00" & ":" & "000" \$ShiftDayF[\$ACounter][\$DayIndex] = \$Temp _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$ShiftDayF[\$ACounter][\$DayIndex], "AI" & \$EWriteCount) ; Send Name _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Formatted_Names[\$dataIndex], "AA" & \$EWriteCount) ; Send Start Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$StartTimes[\$dataIndex], "AB" & \$EWriteCount) ; Send End Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$EndTimes[\$dataIndex], "AC" & \$EWriteCount) ; Send Work Hours _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$HoursWorked[\$dataIndex], "AD" & \$EWriteCount) ; Send Work Group _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkGroup[\$dataIndex], "AE" & \$EWriteCount) ; Send Department _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkDepartment, "AF" & \$EWriteCount) ; Send Supervisor _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Supervisors[\$dataIndex], "AG" & \$EWriteCount) ; Send Notes _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkNotes[\$dataIndex], "AH" & \$EWriteCount) ; Send Shift Number \$tempStime = StringReplace(\$StartTimes[\$dataIndex], ":", "") \$tempEtime = StringReplace(\$EndTimes[\$dataIndex], ":", "") _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, "F " & \$tempStime & "-" & \$tempEtime, "AJ" & \$EWriteCount) \$ACounter += 1 \$EWriteCount += 1 ConsoleWrite(@CRLF & "Friday " & \$Temp & @CRLF) EndIf Next \$yesCount -= 1 \$tF = "N" ElseIf \$tS = "Y" Then For \$Index = \$sdate To \$edate _DayValueToDate(\$Index, \$iYear, \$iMonth, \$iDay) ; Finds the day based on its numerical value (1 = Sunday) If _DateToDayOfWeek(\$iYear, \$iMonth, \$iDay) = 7 Then \$Temp = \$iYear & "-" & \$iMonth & "-" & \$iDay & "T" & "00" & ":" & "00" & ":" & "00" & ":" & "000" \$ShiftDayS[\$ACounter][\$DayIndex] = \$Temp _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$ShiftDayS[\$ACounter][\$DayIndex], "AI" & \$EWriteCount) ; Send Name _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Formatted_Names[\$dataIndex], "AA" & \$EWriteCount) ; Send Start Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$StartTimes[\$dataIndex], "AB" & \$EWriteCount) ; Send End Time _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$EndTimes[\$dataIndex], "AC" & \$EWriteCount) ; Send Work Hours _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$HoursWorked[\$dataIndex], "AD" & \$EWriteCount) ; Send Work Group _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkGroup[\$dataIndex], "AE" & \$EWriteCount) ; Send Department _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkDepartment, "AF" & \$EWriteCount) ; Send Supervisor _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$Supervisors[\$dataIndex], "AG" & \$EWriteCount) ; Send Notes _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, \$WorkNotes[\$dataIndex], "AH" & \$EWriteCount) ; Send Shift Number \$tempStime = StringReplace(\$StartTimes[\$dataIndex], ":", "") \$tempEtime = StringReplace(\$EndTimes[\$dataIndex], ":", "") _Excel_RangeWrite(\$OpenWorkbook, \$OpenWorkbook.ActiveSheet, "S " & \$tempStime & "-" & \$tempEtime, "AJ" & \$EWriteCount) \$ACounter += 1 \$EWriteCount += 1 ConsoleWrite(@CRLF & "Saturday " & \$Temp & @CRLF) EndIf Next \$yesCount -= 1 \$tS = "N" Else ;Error Nothing equals "Y" ConsoleWrite(@CRLF & "Error Nothing equals 'Y'" & @CRLF) EndIf \$DayIndex += 1 \$LoopCount += 1 WEnd \$Array_Index += 1 \$dataIndex += 1 \$dCount += 1 WEnd MsgBox(\$MB_ICONINFORMATION, "Scheduler_Bot", "Finished Sending Data", 2) EndFunc

• Is it possible to use Autoit to find every Monday within a date range? An example would be I want to find every Monday between 1/9/19 through 4/9/19. Then Autoit would give me all the dates on which Monday lands between those two dates.
Sorry but I don't have any code so far. I was wondering if it was even possible. I read the help file and I didn't see a function that could do that.
• By Chimp
Hi
I ask for generic advice on what field format is best to use to store dates in a database (SQLite).
if is a better choice to stored separately year, month and day into 3 separate fields or use one field for a complete date-time group?
I have to store information of this kind:
a person is assigned to a job for a certain day (one day only)
or also
a person is assigned to a job from a day to another day (a range of days)
then i have to query the database for a certain day so to know who is working to a certain job in a specific day.
Well, in the case of ranges of days (for example Mr. Bean works to JOB1 from May/15 to May/20) I have to store one record for each day of the range (6 record in this case) or use only one record with both dates in 2 fields of the same record?
the SQL query should 'ask' who is working on a specific day (even for days in the middle of the ranges).
My doubt is, what's the best way to store ranges of dates (as in the above example), so to be facilitated in the retrieval of those informations.
I'm afraid I'm not been clear, even if I did my best to be, anyway .... any suggestion is welcome..
Thank You
• By chakka
Hello all,

How to calculate the nearest Sunday?

2012/12/30 (Previous Sunday) 2013/01/03(Today) 2013/01/06(Coming Sunday) Here considering today's date(2013/01/03) the nearest Sunday is coming Sunday(2013/01/06)
How to achieve this using AutoIt? any function close to this?

Thanks
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...