Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 20764

Conversion failed when converting the varchar value 'A' to data type smallint.

$
0
0

I tried some of the answer but only get a blank result.

This is my data

SELECT     CUSTOMER_ORDER.SALESREP_ID, CUSTOMER_ORDER.TOTAL_AMT_SHIPPED, CUSTOMER.NAME, CUSTOMER_ORDER.LAST_SHIPPED_DATE,
                      CUST_ORDER_LINE.UNIT_PRICE, CUST_ORDER_LINE.PRODUCT_CODE, CUST_ORDER_LINE.TOTAL_ACT_FREIGHT, CUST_ORDER_LINE.CUST_ORDER_ID,
                      WORK_ORDER.ACT_MATERIAL_COST, WORK_ORDER.ACT_LABOR_COST, WORK_ORDER.ACT_BURDEN_COST, WORK_ORDER.ACT_SERVICE_COST,
                      CUST_ORDER_LINE.COMMODITY_CODE, WORK_ORDER.LOT_ID, CUST_ORDER_LINE.LINE_NO, CUSTOMER_ORDER.ID, WORK_ORDER.BASE_ID
FROM         CUSTOMER_ORDER INNER JOIN
                      CUSTOMER ON CUSTOMER_ORDER.CUSTOMER_ID = CUSTOMER.ID INNER JOIN
                      WORK_ORDER ON CUSTOMER_ORDER.ID = WORK_ORDER.BASE_ID INNER JOIN
                      CUST_ORDER_LINE ON CUSTOMER_ORDER.ID = CUST_ORDER_LINE.CUST_ORDER_ID AND WORK_ORDER.LOT_ID = CUST_ORDER_LINE.LINE_NO AND
                      WORK_ORDER.BASE_ID = CUST_ORDER_LINE.CUST_ORDER_ID AND WORK_ORDER.BASE_ID = CUST_ORDER_LINE.CUST_ORDER_ID
WHERE     (CUST_ORDER_LINE.CUST_ORDER_ID = 'customer_order_id')

Under where if I type in the actual customer order id I get the results, however if I remove the where clause then

I get the error message Conversion failed when converting the varchar value 'A' to data type smallint. I need to make the where clause so I can search on any customer order.


Viewing all articles
Browse latest Browse all 20764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>