I have a pass thru query that is passing parameter to a stored procedure in SQL. When I try to run the query I am getting an error that says:
"ODBC - Call Failed. Error converting data type varchar to numeric. (#8114)
This is what my query looks like with the parameters manually entered into it. Normally they are put in the query from form controls but to make it simple to post here I just put the parameters in manually. Once I fire that query I get that error message.
Execute upMySprocHistory '11/1/2016', '11/1/2016', '100987','','',''
Below is my stored procedure in SQL. Not sure if I have the data types set properly and which one is causing that error.
ALTER PROCEDURE [dbo].[upMySprocHistory]
@FieldDateFrom Varchar(50) = '',
@FieldDateTo Varchar(50) = '',
@FieldCustNo numeric(6,0) = '',
@FieldGroupCode Varchar(50) = '',
@FieldQtyMin Varchar(50) = '',
@FieldQtyMax Varchar(50) = ''
FROM viewHistoricalData v
WHERE ((@FieldDateFrom = '') Or (v.DateCreated)>= @FieldDateFrom) AND
((@FieldDateTo = '') Or (v.DateCreated)<= @FieldDateTo) AND
((@FieldCustNo = '') Or Convert(numeric(6,0),(v.CustNo))= @FieldCustNo) AND
((@FieldGroupCode = '') Or (v.GroupCode)= @FieldGroupCode) AND
((@FieldQtyMin = '') Or (v.Quantity)>= @FieldQtyMin) AND
((@FieldQtyMax = '') Or (v.Quantity)<= @FieldQtyMax)