I am trying to calculate a Work Order Start Date in a query. This is based on some characteristics of the order and it skips weekends. However, when I run this query, the date shows as 12:00 am. What am I missing?
Function CreateWOSDDate(ByVal PreFin As String, ByVal DrStyle As String, ByVal Deldate As Date) As Variant
Dim AddColor As Boolean
Dim intNumDays As Integer
Dim StartDate As Date
Select Case PreFin
Case "BR17", "BR28", "WH06"
AddColor = True
Case Else
AddColor = False
End Select
Select Case DrStyle
Case "DCREag", "DCRHWK", "DCRFAL", "RP-9", "RP-22", "RP-23"
If AddColor Then
intNumDays = 7
Else
intNumDays = 6
End If
Case Else
If AddColor Then
intNumDays = 7
Else
intNumDays = 4
End If
End Select
StartDate = MinusWorkdays(Deldate, intNumDays)
End Function
Function CreateWOSDDate(ByVal PreFin As String, ByVal DrStyle As String, ByVal Deldate As Date) As Variant
Dim AddColor As Boolean
Dim intNumDays As Integer
Dim StartDate As Date
Select Case PreFin
Case "BR17", "BR28", "WH06"
AddColor = True
Case Else
AddColor = False
End Select
Select Case DrStyle
Case "DCREag", "DCRHWK", "DCRFAL", "RP-9", "RP-22", "RP-23"
If AddColor Then
intNumDays = 7
Else
intNumDays = 6
End If
Case Else
If AddColor Then
intNumDays = 7
Else
intNumDays = 4
End If
End Select
StartDate = MinusWorkdays(Deldate, intNumDays)
End Function