Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Statement Confusion
Message
 
À
30/11/1999 12:09:31
Jimmy Ditta
Twin City Electronics
Monroe, Louisiane, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00296934
Message ID:
00296940
Vues:
26
You really don't want to do this with a single select, but rather with a separate select for each table using a UNION to combine the data for the report. Try this:

select data1.boardfeet, data1.total ;
from data1 ;
where data1.siz = thisform.pageframe1.page2.sz1.displayvalue;
UNION ;
select data1.boardfeet, data1.total ;
from data1 ;
where data1.siz = thisform.pageframe1.page2.sz1.displayvalue;
UNION ;
select data1.boardfeet, data1.total ;
from data1 ;
where data1.siz = thisform.pageframe1.page2.sz1.displayvalue;
into cursor myrptdata

HTH

Mike Antonovich

>There are 9 tables: totals_table, data1, data2, data3, . . . , data8
>
>each data# table has the same fields: shipdataid, num_bundles, size, length, grade, boardfeet, price_per_thou_boardft (not real name), total
>
>note: the reason they have the same fields is because each table is attached to a SEPARATE ROW of controls on the same form.
>
>I want to build a "report making form", where the user can choose conditions from comboboxes and create a report based on the conditions he chose.
>
>I'm starting with a single combo and cmd button. In the combo, I put the same values found in the size fields from tables data1 - data8.
>These values are 2x4, 2x6, 2x8, . . .
>
>In the button's click event I put this code:
>
>select data1.boardfeet, data2.boardfeet, data3.boardfeet, data1.total, data2.total, data3.total;
> from data1, data2, data3;
> where data1.siz = thisform.pageframe1.page2.sz1.displayvalue;
> or data2.siz = thisform.pageframe1.page2.sz1.displayvalue;
> or data3.siz = thisform.pageframe1.page2.sz1.displayvalue;
>
>I'm not getting what I'm supposed to.
>
>If anyone has suggestions or advice on this report, I'm all ears.
>
>Thanks
>JD
Michael P. Antonovich, MCSD
Email: mike@micmin.com
MicMin Associates - Orlando, FL


Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform