[AccessD] Data type mismatch in function

jwcolby jwcolby at colbyconsulting.com
Wed Dec 5 12:33:55 CST 2012


good catch.

John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it

On 12/5/2012 12:36 PM, RANDALL R ANTHONY wrote:
> Couldn't be this, could it?
>
>>       Case "FL" Or "FM" Or "FH", "
>
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
> Sent: Wednesday, December 05, 2012 12:15 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Data type mismatch in function
>
>
>
> I noticed that right after posting. Unfortunately that did not fix the problem.
>
>
>
> -----Original Message-----
>
> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
>
> Sent: Wednesday, December 05, 2012 11:05 AM
>
> To: Access Developers discussion and problem solving
>
> Subject: Re: [AccessD] Data type mismatch in function
>
>
>
> I don't see return status dimensioned in the function.  If it isn't dimensioned then it will be dynamically dimensioned as type variant which may be causing an issue somehow.
>
>
>
> John W. Colby
>
> Colby Consulting
>
>
>
> Reality is what refuses to go away
>
> when you do not believe in it
>
>
>
> On 12/5/2012 11:54 AM, Kaup, Chester wrote:
>
>> I am calling the following function from a query. I get a type mismatch error at the first record. Value of status is "PA".  I don't understand the mismatch. Thanks.
>
>>
>
>> Here is the SQL.  dbo_DSS_StatusChanges is an SQL server table with
>
>> status as a data type of text
>
>>
>
>> SELECT PID, WellStatus(Status) AS ReturnStatus FROM
>
>> dbo_DSS_StatusChanges;
>
>>
>
>> Here is the function:
>
>>
>
>> Public Function WellStatus(Status As String) As String
>
>>
>
>> Select Case Status
>
>>       Case "FL" Or "FM" Or "FH", "PL" Or "PM" Or "PH" Or "SL" Or "SM" Or "SH" Or "SP" Or "RL" Or "RM" Or "RH" Or "RP"
>
>>           ReturnStatus = "PRD"
>
>>       Case "CI" Or "WAGC"
>
>>           ReturnStatus = "GasI"
>
>>       Case "WD" Or "WI" Or "WC" Or "WCH" Or "WF"
>
>>           ReturnStatus = "WI"
>
>>       Case Else
>
>>           ReturnStatus = ""
>
>> End Select
>
>>
>
>> WellStatus = ReturnStatus
>
>>
>
>> End Function
>
>>
>
>
>
> --
>
> AccessD mailing list
>
> AccessD at databaseadvisors.com
>
> http://databaseadvisors.com/mailman/listinfo/accessd
>
> Website: http://www.databaseadvisors.com
>
>
>
>
>
> --
>
> AccessD mailing list
>
> AccessD at databaseadvisors.com
>
> http://databaseadvisors.com/mailman/listinfo/accessd
>
> Website: http://www.databaseadvisors.com
> -------------Disclaimer---------------
>
> This electronic message and its contents and attachments contain information from Sentara Healthcare and is confidential or otherwise protected from disclosure. The information is intended to be for the addressee only.
>
> If you are not the addressee, any disclosure, copy, distribution or use of the contents of this message is prohibited. If you have received this electronic message in error, please notify us immediately and destroy the original message and all copies.
>



More information about the AccessD mailing list