<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — help with a SQL statement]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=811&amp;type=atom" />
	<updated>2009-12-04T18:49:06Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=811</id>
		<entry>
			<title type="html"><![CDATA[Re: help with a SQL statement]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=4050#p4050" />
			<content type="html"><![CDATA[<p>Ok forget what I just said about location.. I just not getting result I need. I need &quot;codes.stock_id, codes.description, stock.reorder_qty&quot; and more later.</p><p>Where &quot;stock.reorder_level &lt; (Re-Order Level)&quot; for Location X.</p><p>Tom, I guess it is a date issue, what I need to add is Quantity On Hand, for today, stock.reorder_level &lt; moves.qty; needs to be for todays date, for that stock_id.&nbsp; Something like the function get_qoh_on_date.</p><p>Sorry I don&#039;t know much about this...&nbsp; what do ya think?</p><p>AM</p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-12-04T18:49:06Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=4050#p4050</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: help with a SQL statement]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=4048#p4048" />
			<content type="html"><![CDATA[<p>Hi Alvin,</p><p>&nbsp; I&#039;m not totally sure I follow.&nbsp; Could you clarify your needs?</p><p>Tom</p>]]></content>
			<author>
				<name><![CDATA[tomhallman]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=406</uri>
			</author>
			<updated>2009-12-04T18:08:06Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=4048#p4048</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: help with a SQL statement]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=4047#p4047" />
			<content type="html"><![CDATA[<p>Hello Tom, Thanks for your help!!</p><p>I need to add, where stock.reorder_level &gt;= moves.qty; (location,qty) I need to sort be Location Qty, not all location&#039;s qty&#039;s,&nbsp; did I say that right?</p><p>Thanks for all the help from the SQL Dept.</p><p>Alvin</p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-12-04T18:01:48Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=4047#p4047</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: help with a SQL statement]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=3377#p3377" />
			<content type="html"><![CDATA[<p>Hi Alvin,</p><p>&nbsp; I&#039;m a little rusty on my joins and I don&#039;t particularly use the Items and Inventory module, but is this something like what you&#039;re looking for?&nbsp; (I&#039;m assuming those Xs are actually referring to different values, that is, X and Y.)</p><p>select distinct codes.stock_id, codes.description<br />&nbsp; from 0_item_codes as codes <br />&nbsp; &nbsp; &nbsp; &nbsp;left join 0_loc_stock as stock on (codes.stock_id = stock.stock_id)<br />&nbsp; &nbsp; &nbsp; &nbsp;left join 0_purch_data as purch on (stock.stock_id = purch.stock_id)<br />&nbsp; &nbsp; &nbsp; &nbsp;left join 0_stock_moves as moves on (purch.stock_id = moves.stock_id)<br /> where stock.loc_code LIKE &#039;X&#039; and<br />&nbsp; &nbsp; &nbsp; &nbsp;purch.supplier_id = Y and<br />&nbsp; &nbsp; &nbsp; &nbsp;stock.reorder_level &gt;= moves.qty;</p><p>~Tom</p>]]></content>
			<author>
				<name><![CDATA[tomhallman]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=406</uri>
			</author>
			<updated>2009-09-01T13:01:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=3377#p3377</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[help with a SQL statement]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=3361#p3361" />
			<content type="html"><![CDATA[<p>I would like some help with a SQL statement.</p><p>I know that the PO system is being worked on and will get better with time, but if I could just do a query on the database for now it would be a big help.</p><p>I would like to display columns 0_item_codes.stock_id, 0_item_codes.description,&nbsp; and maybe more later.</p><p>Where<br />0_loc_stock.loc_code =X and<br />0_purch_data.supplier_id =X and<br />0_loc_stock.reorder_level is =&gt; 0_stock_moves.qty</p><p>Something like that...</p><p>If anyone out there can help with this or has put a query together for PO&#039;s it would be a great help?</p><p>Thanks</p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-08-28T23:35:38Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=3361#p3361</id>
		</entry>
</feed>
