G
Guest
I am running a query on Sales data, which contains Opportunity Status and
Fallout Reason field. In the Opp. Status field, the options are Closed or
Closed-Won. In the case where the status is Closed, the Fallout reason will
have a list of various different reasons, such as No-Bid, Cancelled,
LOST-PRICE, LOST-SPEED, etc. I need to have a single number each for Lost,
No-Bid, Cancelled, and Won. I have written some VBA code to assist with this:
Function GetStatus(ByVal strStatus As String, Optional strFallout As String
= "") _ As String
If strStatus <> "Closed-Won" Then
If (Left(strFallout, 4) <> "LOST") Then
GetStatus = strFallout
Else
GetStatus = "Lost"
End If
Else
GetStatus = strStatus
End If
End Function
When I run this in my query, I receive a Data Mismatch in criteria error.
Please help!
Fallout Reason field. In the Opp. Status field, the options are Closed or
Closed-Won. In the case where the status is Closed, the Fallout reason will
have a list of various different reasons, such as No-Bid, Cancelled,
LOST-PRICE, LOST-SPEED, etc. I need to have a single number each for Lost,
No-Bid, Cancelled, and Won. I have written some VBA code to assist with this:
Function GetStatus(ByVal strStatus As String, Optional strFallout As String
= "") _ As String
If strStatus <> "Closed-Won" Then
If (Left(strFallout, 4) <> "LOST") Then
GetStatus = strFallout
Else
GetStatus = "Lost"
End If
Else
GetStatus = strStatus
End If
End Function
When I run this in my query, I receive a Data Mismatch in criteria error.
Please help!