ChrisM@Work (3/6/2013)
Plateau (3/6/2013)
ChrisM@Work (3/6/2013)
You have single quoted a variable, making it a string-type constant: '@Date_Last_Payment'Hi Chris,
I have temporarily changed it to a varchar - in the input parameters bit however I still get the following error
Server: Msg 170, Level 15, State 1, Procedure STP_Agent_upload, Line 92
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 92: Incorrect syntax near ' Reason: there is no transaction that matches the policy number, agent and transaction date specified.'.
Thanks
Have you removed the single quotes from around the variable - everywhere it appears in the sproc?
Hi Chris,
Not sure I understand. Sorry...
The colour of the statement seem to show it is correct?
Or do you mean the initialising bit is wrong?
If I cut my query right down - then I am still getting incorrect syntax
CREATE PROCEDURE [dbo].[STP_Agent_upload]
(
-- List Input Parameters
@Agent_Number VARCHAR(50), --column A
@Date_Last_Payment VARCHAR(50),--column C
@policy_number VARCHAR (50),--column D
@Agent_Payment_Amount VARCHAR (50),-- [Net] -> this is column M
@Row_Number VARCHAR (100),--PASS this from IMS!
@Return_Message VARCHAR (255) OUTPUT
)
AS BEGIN
--List Variables Here
DECLARE @Record_Count AS VARCHAR (100)--Used to flag whether there is an existing record
DECLARE @productAS VARCHAR (100)
DECLARE @Agent_URNAS VARCHAR (100)
DECLARE @InsurerAS VARCHAR (100)
DECLARE @Transaction_CounterAS VARCHAR (100)
DECLARE @Agent_Introducer_URNAS VARCHAR (100)
DECLARE @CompanyAS VARCHAR (100)
---------------------------------------------Calculations---------------------------------------------
--1. Find Product
SELECT @product = [Cover type] FROM policytype WHERE [policy prefix] = LEFT (@policy_number, 2)
IF @product = '' SET @Return_Message = @policy_number