<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: SQL Command </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/sql-command</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/sql-command/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>aznan on SQL Command </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/sql-command#p16939</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/sql-command#p16939</guid>
        	        	<description><![CDATA[<p>problem solve&#8230; my fault&#8230; &#160;everything is a.o.k.. I just rewrite or copy .. and voila it works GREAT!!! cant really explain .. Jqgrid ROCK!</p>
<p>hv I one last problem though, my search didnt work&#8230;. &#160;any idea where i should put the ".$wh." in my code???</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2935' value='Select Code' data-codeid='sfcode2935' /></p>
<div class='sfcode' id='sfcode2935'>$SQL = &#34;SELECT tbl_po.int_poid, tbl_supplier.txt_supplier, CONCAT(tbl_item.txt_itemcode,&#39;:&#39;,tbl_item.txt_itemdescription) AS item, SUM(tbl_podetail.int_qty*tbl_podetail.fl_unitprice) AS amount, tbl_po.dt_appdate FROM tbl_podetail INNER JOIN tbl_po ON tbl_podetail.int_poid = tbl_po.int_poid INNER JOIN tbl_supplier ON tbl_supplier.int_supplierid = tbl_po.int_supplierid INNER JOIN tbl_item ON tbl_item.int_itemid = tbl_podetail.int_itemid INNER JOIN tbl_metric ON tbl_metric.int_metricid = tbl_item.int_metricid GROUP BY tbl_po.int_poid, tbl_supplier.txt_supplier, tbl_podetail.fl_unitprice, tbl_metric.txt_metric, tbl_po.dt_appdate ORDER BY &#34;.$sidx.&#34; &#34;. $sord.&#34; LIMIT &#34;.$start.&#34; , &#34;.$limit;</div>
<p>or do i need to do something else&#8230;</p>
]]></description>
        	        	<pubDate>Thu, 06 May 2010 11:35:38 +0300</pubDate>
        </item>
        <item>
        	<title>aznan on SQL Command </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/sql-command#p16938</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/sql-command#p16938</guid>
        	        	<description><![CDATA[<p>i manage to use SUM.. but still can&#39;t understand why INNER JOIN wont work... but my major problem is still givin me headache..!!!</p>
<p>HELLPPP!!</p>
]]></description>
        	        	<pubDate>Thu, 06 May 2010 11:20:03 +0300</pubDate>
        </item>
        <item>
        	<title>aznan on SQL Command </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/sql-command#p16911</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/sql-command#p16911</guid>
        	        	<description><![CDATA[<p>I hv 2 tables on purchase order. &#160;Main table: tbl_po which contain [int_poid, tbl_po.dt_appdate etc] and detail table: tbl_podetail which contain [int_podetail, int_po, int_qty, fl_unitpric]&#160;.</p>
<p>I try to put this inside my data url for my grid.. select option</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8077' value='Select Code' data-codeid='sfcode8077' /></p>
<div class='sfcode' id='sfcode8077'>SELECT tbl_po.int_poid, tbl_supplier.txt_supplier, SUM(tbl_podetail.int_qty*tbl_podetail.fl_unitprice) AS amount, tbl_po.dt_appdate FROM tbl_podetail INNER JOIN tbl_po ON tbl_podetail.int_poid = tbl_po.int_poid INNER JOIN tbl_supplier ON tbl_supplier.int_supplierid = tbl_po.int_supplierid INNER JOIN tbl_item ON tbl_item.int_itemid = tbl_podetail.int_itemid INNER JOIN tbl_metric ON tbl_metric.int_metricid = tbl_item.int_metricid GROUP BY tbl_po.int_poid, tbl_supplier.txt_supplier, tbl_podetail.fl_unitprice, tbl_metric.txt_metric, tbl_po.dt_appdate ORDER BY tbl_po.int_poid ASC</div>
</p>
<p>it runs OK if i omit some code and become like this &#160;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5852' value='Select Code' data-codeid='sfcode5852' /></p>
<div class='sfcode' id='sfcode5852'>&#34;SELECT tbl_po.int_poid, tbl_po.dt_appdate, tbl_supplier.txt_supplier FROM tbl_po, tbl_supplier WHERE tbl_po.int_supplierid = tbl_supplier.int_supplierid AND int_poid&#34;.$wh.&#34; ORDER BY &#34;.$sidx.&#34; &#34;. $sord.&#34; LIMIT &#34;.$start.&#34; , &#34;.$limit;</div>
<p>or is it not possible to run SQL command in jqgrid like SUM, MIN, AVG, INNER JOIN etc.. I run the same query inside phpmyadmin and it &#160;return some output. I look through some of the sample in demo, master detail, subgrid.. but I cant find the solution.. coz in the demo there is a field for amount in the master table.. in my case the amount is not exist in my tbl_po. &#160;I can create the (tbl_podetail.int_qty*tbl_podetail.fl_unitprice) as amount only on the "tbl_podetail" jqgrid like this</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4844' value='Select Code' data-codeid='sfcode4844' /></p>
<div class='sfcode' id='sfcode4844'>SELECT tbl_podetail.int_podetailid, tbl_podetail.int_poid, &#160;(tbl_podetail.fl_unitprice*tbl_podetail.int_qty) AS amount, tbl_podetail.dt_require &#160;FROM tbl_podetail &#160;WHERE &#160;int_poid=&#34;.$apid.&#34; &#34;.$wh.&#34; ORDER BY &#34;.$sidx.&#34; &#34;. $sord.&#34; LIMIT &#34;.$start.&#34; , &#34;.$limit;</div>
<p>but this does not settle my problems.. i wish to create a grnd total to be passed to the amount.. just like the masted detail example&#8230;. coz i want to create some sort of summary..</p>
<p>hellpp pleaseee&#8230;</p></p>
]]></description>
        	        	<pubDate>Wed, 05 May 2010 11:19:59 +0300</pubDate>
        </item>
</channel>
</rss>