on 2011 Mar 01 12:02 PM
I have produced the query below so that it will alert our purchaser when he needs to chase up undelivered goods inwards. I want the qty only to display as a whole number rather than having 3 decimal places after it, i am sure there is way of doing this just not sure how to
SELECT T0.[DocNum] AS Doc, T0.[CardName]AS Supplier, T1.[LineNum] AS Row, T1.[ItemCode] AS Code, T1.[Dscription] As Desciption, T1.[Quantity] AS Qty, T1.[ShipDate] AS [Del. Date], T1.[OpenQty] AS [Qty to Deliver] FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ShipDate] > GETDATE() -7 AND T1.[ShipDate] < GETDATE() +7 AND T0.[DocStatus] = 'O' AND T1.[OpenQty] > 0 AND T1.[LineStatus] = 'o'
Hi David ,
Try:
SELECT T0.DocNum AS Doc, T0.CardName AS Supplier, T1.LineNum AS Row, T1.ItemCode AS Code,
T1.Dscription As Desciption, cast(T1.Quantity as integer) AS Qty, T1.ShipDate AS 'Del. Date', cast(T1.OpenQty as integer) AS 'Qty to Deliver'
FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T1.ShipDate > GETDATE() -7 AND T1.ShipDate < GETDATE() +7 AND T0.DocStatus = 'O'
AND T1.OpenQty > 0 AND T1.LineStatus = 'o'
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just want a whole number no decimals is that possible
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It only gets rid of one decimal! Nearly there!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
if need 2 decimal place , try this
SELECT T0.DocNum AS Doc, T0.CardName AS Supplier, T1.LineNum AS Row, T1.ItemCode AS Code,
T1.Dscription As Desciption, cast(Round(T1.Quantity,1)as decimal(30,2)) AS Qty, T1.ShipDate AS 'Del. Date'
,cast(Round(T1.OpenQty,1)as decimal(30,2))AS 'Qty to Deliver'
FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T1.ShipDate > GETDATE() -7 AND T1.ShipDate < GETDATE() +7 AND T0.DocStatus = 'O'
AND T1.OpenQty > 0 AND T1.LineStatus = 'o'
regards
--
Ashish
Edited by: ASHISH RANJAN on Mar 1, 2011 5:56 PM
Hi David ,
Try this :
SELECT T0.DocNum AS Doc, T0.CardName AS Supplier, T1.LineNum AS Row, T1.ItemCode AS Code,
T1.Dscription As Desciption, cast(Round(T1.Quantity,1)as decimal(30,0)) AS Qty, T1.ShipDate AS 'Del. Date'
,cast(Round(T1.OpenQty,1)as decimal(30,0))AS 'Qty to Deliver'
FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T1.ShipDate > GETDATE() -7 AND T1.ShipDate < GETDATE() +7 AND T0.DocStatus = 'O'
AND T1.OpenQty > 0 AND T1.LineStatus = 'o'
Thanks
--
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
9 | |
8 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.