I am trying to get some information out of my database from Java.
String sql_get_Tot = "
SELECT
dbo.table1.Quantity * dbo.table2.CostPerIndivdual AS QC
FROM
dbo.table1
INNER JOIN
dbo.table2
ON dbo._IISJoin.ItemID = dbo.table2.ItemID
WHERE
dbo.table1.SupplierID = 2 AND
dbo.table1.ItemID = 1 AND
dbo.table1.InvoiceID = 2
";
state = con.createStatement();
total = state.executeQuery(sql_get_Tot);
totalsql = total.getFloat(1);
This Returns nothing within the result set
Run Exactly the same query in MSSQL and I get 10.00
any ideas what is going wrong here, I have checked the basics such as connected to the right database and so on.
Thanks for any help you might be able to provide in advance.
.1. In Java you should be usingBigDecimal.