Ernesto_Paez
MIS
Hi Guys,
Let me explain, what i do i need to accomplish here, the Select SQL below actually do what i want but now, i got presented with a different issue.
when i type in the search text1 box for a value, if the item is common in both tables, then i can get a match and pull the Price from T2 but it could be the case that maybe, the item, does not exist in T2, for hence then, the result in the cursor, won't display, the item i was searching but the item exist in T1, so i need to still get the values from T1 and sent them to the cursor, in this case then what is going to happen is, that "T2.PRICE, won't be in the cursor ", ok so, what i need then if there is not matching, on item from both tables, to be able to send the searched item and the rest of the values of the fields from T1 to the cursor anyway, of course Price from T2, won't be there
can anyone help me on this SQL to add the code to accomplish it ?
or do i need to create a second Select sql for it in case the first one does not apply ?
I meant if the first sql, _tally=0, then i need to create a second Select sql, to just show the search item from T1 ?
Below is the SELECT SQl, i have in the txtbox interactivechange
Thanks in advance
Let me explain, what i do i need to accomplish here, the Select SQL below actually do what i want but now, i got presented with a different issue.
when i type in the search text1 box for a value, if the item is common in both tables, then i can get a match and pull the Price from T2 but it could be the case that maybe, the item, does not exist in T2, for hence then, the result in the cursor, won't display, the item i was searching but the item exist in T1, so i need to still get the values from T1 and sent them to the cursor, in this case then what is going to happen is, that "T2.PRICE, won't be in the cursor ", ok so, what i need then if there is not matching, on item from both tables, to be able to send the searched item and the rest of the values of the fields from T1 to the cursor anyway, of course Price from T2, won't be there
can anyone help me on this SQL to add the code to accomplish it ?
or do i need to create a second Select sql for it in case the first one does not apply ?
I meant if the first sql, _tally=0, then i need to create a second Select sql, to just show the search item from T1 ?
Below is the SELECT SQl, i have in the txtbox interactivechange
Code:
Procedure Text1.InteractiveChange
Local lcSearch
lcSearch = Upper(Alltrim(This.Value))
Thisform._cSearch = m.lcSearch
path_1="f:\mfg\std\standard"
path_2="f:\mfg\prices"
select (t1.item) as itemno, (T1.draw_size) as DrawSize, (T1.prc) as PRC,;
(T1.descrip) as description, (T1.descrip2) as Cross_Reference,;
(T1.VPARTNO)as VendorPartNo,(T2.price) as Price,;
(T1.cost) as Cost,(T1.onhand) as On_Hand, (T1.orderpt) as OrderPoint,;
(T1.orderqty) as OrderQty, (T1.onorder) as OnOrder,;
(T1.order_date) as OrderDate, (T1.need_by)as NeededBy,;
(T1.allocated) as SetUp, (T1.run_avg) as Run ;
from (path_1) T1 inner join(path_2) T2 on (T1.item) = (T2.item);
WHERE (T1.item + T1.VPARTNO) LIKE '%'+lcSearch+'%' into cursor Junkresult2 NOFILTER
Select Junkresult
Zap In Junkresult
Append From DBF('Junkresult2')
Go Top
Thisform.grid1.Refresh
Endproc