首页 > 解决方案 > One Incorrect value from single data point using sqlcmd query

问题描述

SQL query using sqlcmd is missing/showing default date for one datapoint using a Join - Problem

I am using sqlcmd to query a large database. For one datapoint (SalesTransaction #33975) the date is coming up as blank or rather 1/1/1900. Using a separate program the date comes through so the date is there. The other dates are correct

SELECT sl.SalesLine, st.Transaction_no, sl.item, CAST(st.invoicedate as DATE) AS InvDate
FROM Salestransactions st RIGHT JOIN SalesLines sl 
ON st.transaction_no = sl.transaction_no;

For Transaction_No = 3397 the Invoice Date = 1/1/1900 I have not filtered for this transaction rather the dates for the other transactions are correct. I have tried to keep the coding simple to help pinpoint the problem. I simply need some direction on how to research this further. Thank you

标签: sqlsql-serversqlcmd

解决方案


推荐阅读