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
return an email object's guid
copy query results into email body using vb and format like cut and paste
How do I calculate software availability in an Excel spreadsheet?
vb.net - save data from listview
How do trigger an automatic e-mail alert that is based on a date field in an SQL database?
VB PowerPack in C#
Error message from SQL Server 2005 appearing in SQL Server 2008
SQL Query
RS-485 Serial Communications
Looking for a way to edit our Global Address list in 2003 server AD