Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select recno() from table1, table2 (which table??)
Message
De
31/12/2001 09:59:11
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
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:
00599357
Vues:
14
>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

Stephen,
Normally it would be reno('alias'). However when used with multiple tables it's never trustable (and never worked right in fox2x too). It only by chance does it right if the table is not open at that moment.
Better use PKField of receipt if there is one. If there isn't then you could first select into a temp table to have a column for recnos :

*Fox2x
select *, recno() as rcno from receipt WHERE .T. into crsTemp

*VFP
select *, recno() as rcno from receipt into crsTemp NOFILTER

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform