Microsoft
Software
Hardware
Network
Question : Doing Some math in a Select
I want to see if the qty on hand(QOH) is half of the FullPalletQty(FPQ)
so if item xyz has 20 on hand (QOH) and the item master shows full pallet qty (FPQ)=48
it would be .T.
since 20-48=28 (this is < half(48))
I want my select (if this is the best place to do it?) to....
SELECT item, qoh, fpq,
FROM MyTable ;
WHERE ((qoh-fpq) < (fpq/2));
into cursor cReults readwrite
Answer : Doing Some math in a Select
It is much simpler:
SELECT item, qoh, fpq ;
FROM MyTable ;
WHERE qoh >= fpq/2 ;
into cursor cReults readwrite
SELECT item, qoh, fpq, ROUND(qoh/fpq, 0) AS Percentage ;
FROM MyTable ;
WHERE qoh >= fpq/2 ;
into cursor cReults readwrite
BTW, 20-48= -28
Random Solutions
Long SQL String is Wrapping and Not Running in Access VBA
How does DBCC test the integrity of a database?
What does an MFC resource file with texts of more than one language look like?
Create Pie Chart in Excel 2007
Delphi to VB.NET
Load progress bar C#, asp.net
On timer event passes it's own time
Open and Print PDF file
How can I automatically (VBA) insert a comment when certain condition exist in a cell;
How to format SQL query string in vb.net for a multi-field index in Access??