Does anyone know how i can overcome this error? I currently have this query where i am converting the COBOL numbers into actual dollar amounts. What i want to now is sum up the actual dollar amounts (Amount_$ below) but when i do a Sum query it gives an error for "Data Type mismatch" can anyone please help?
SELECT [Record].Amount, IIf([Amount] Is Null Or (Right([Amount],1) Not In ('{','a','b','c','d','e','f','g','h','i','j','k',' l','m','n','o','p','q','r','{')),"Amount formatted incorrectly", IIf(Right([Amount],1)='{',1,IIf(Right([Amount],1)='}',-1,IIf(Right([Amount],1)<'J',1,-1)))*(Left([Amount],Len([Amount])-1)*10+IIf(Right([Amount],1)='{' Or Right([Amount],1)='}',0,IIf(Right([Amount],1)<'J',Asc(Right([Amount],1))-64,IIf(Right([Amount],1)<'S',Asc(Right([Amount],1))-73,0))))/100) AS [Amount_$]
FROM Record;
SELECT [Record].Amount, IIf([Amount] Is Null Or (Right([Amount],1) Not In ('{','a','b','c','d','e','f','g','h','i','j','k',' l','m','n','o','p','q','r','{')),"Amount formatted incorrectly", IIf(Right([Amount],1)='{',1,IIf(Right([Amount],1)='}',-1,IIf(Right([Amount],1)<'J',1,-1)))*(Left([Amount],Len([Amount])-1)*10+IIf(Right([Amount],1)='{' Or Right([Amount],1)='}',0,IIf(Right([Amount],1)<'J',Asc(Right([Amount],1))-64,IIf(Right([Amount],1)<'S',Asc(Right([Amount],1))-73,0))))/100) AS [Amount_$]
FROM Record;