Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select recno() from table1, table2 (which table??)
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00599330
Message ID:
00599340
Vues:
18
This message has been marked as the solution to the initial question of the thread.
Tha workaround I use in case like this is to split query into two parts. First, select the header records with RECNO() filed added and than use it in the query that joins it with details.

>in 2.6x yes but no dice in 6.0
>
>
>>It doesn't change the fact, that result returned by RECNO() function in such query isn't guarantied to be correct. You just got lucky. :)
>>
>>>Hello Sergey
>>>
>>>"The Recno(), Reccount() and other alike function return incorrect result when used in multiple-table queries."
>>>
>>>in foxpro 2.6x (DOS) I have a multiple-table querie where the recno() just so happens to be returned from the table that I want and it works fine.
>>>
>>>same SQL as before then while browsing the queried table ;
>>>m = cursor.exp_1
>>>select receipt
>>>goto m
>>>
>>>it works great and has for 3 years
>>>
>>>
>>>>Hi Stephen,
>>>>
>>>>The Recno(), Reccount() and other alike function return incorrect result when used in multiple-table queries. Also, you cannot specify alias in those function even if they used in one table query because SELECT doesn't use your work areas; it performs the equivalent of USE ... AGAIN.
>>>>It's documented in 'SELECT - SQL Command' topic in help file. (look for RECNO).
>>>>
>>>>>Hello Everybody
>>>>>
>>>>>I have a SQL statement (The SQL statement works fine)
>>>>>
>>>>>IF pl_show = .F.
>>>>> l_str = "receipt.recon = CTOD(' / / ') "
>>>>>ELSE
>>>>> l_str = "receipt.recon <> CTOD(' / / ') "
>>>>>ENDIF
>>>>>frmWait.RELEASE()
>>>>>DEFINE WINDOW sql_win FROM 0,0 TO 1,1
>>>>>SET TALK WINDOW sql_win
>>>>>SET TALK ON
>>>>>SET SAFETY OFF
>>>>>SELECT *, (receipt.receipt_qty * receipt.receipt_cost), RECNO() ;
>>>>> FROM receipt, purchase_head ;
>>>>> WHERE purchase_head.order_numb = receipt.order_numb AND ;
>>>>> BETWEEN(receipt.receipt_date, pd_start, pd_end) AND ;
>>>>> purchase_head.cc_name = lc_name ;
>>>>> AND &l_str ;
>>>>> ORDER BY purchase_head.vendor_id, ;
>>>>> purchase_head.ven_invoice, ;
>>>>> receipt.pack_slip ;
>>>>> INTO TABLE (gcOld_Dir)+'recon.DBF'
>>>>>
>>>>>ok now how do be sure that I am getting the recno() from the receipt table?? I can't say receipt.recno()?? Can I, I get a error "Object receipt not found"
>>>>>
>>>>>
>>>>>Thanks for any help
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform