Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Description Sequence...
Message
De
06/08/2001 16:25:04
N. Lea
Nic Cross Enterprises
Valencia, Californie, États-Unis
 
 
À
06/08/2001 15:15:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00540161
Message ID:
00540388
Vues:
15
Hi there!

I attempted what you stated. BTW - printorder is the key field. It did work in a sense that it changed the descript field, but now it filtered only on one of the printorders (the last one to be precise).

If I try to change it to anything but the print field I get PRINTORDER is not UNIQUE or QUALIFIED. So I change it and it works fine except for the descript fields still all say the same thing.

I tried an IIF in the 3rd line, but it only took the first line item from reportnames and blanked out the rest of them because I had:

IIF(report1.printorder = reportnames.printorder, reportnames.descript, ' ') AS descript


SELECT 'X' AS report_1, ;
reportnames.descript AS descript, ;
ROUND(SUM(IIF(groupcode = groupcode AND !EMPTY(I_L),total, 0)),2) AS Total, ;
reportnames.printorder AS printorder, ;
groupcode AS groupcode, ;
"X" AS I_L ;
FROM Reportnames, Report1 ;
JOIN reportnames ON Report1.printorder= reportnames.printorder;
GROUP BY Report1.Groupcode ;
ORDER BY I_L ;
INTO CURSOR SummaryTable
COPY ALL TO ARRAY gaTempCursor


>The problem is in here: The reportnames table needs to be in the select's from clause.
>As it is, it's just using the current record in reportnames. If you moved to the 5th record, e.g., you would get that description in all records of the result. The end result is just like using 'X' as report_1.
>
>I don't know what common field the reportnames table and report1 table should be joined on, so I put in report_1 as an example.
>Of course, this will need to be replaced with the appropriate field, and if they have more fields in common, those fields will need to be aliased in the select - I have aliased the group by field as an example.
>
>
>**-- SECTION 2: Copies and calculates all data into a cursor --**     
>SELECT 'X' AS report_1, ;
>     reportnames.descript AS descript, ;
>     ROUND(SUM(IIF(groupcode = groupcode AND !EMPTY(I_L),total, 0)),2) AS Total, ;
>     printorder AS printorder, ;
>     groupcode AS groupcode, ;
>     "X" AS I_L ;
>     FROM Report1 ;
>     Join reportnames On Report1.report_1 = reportnames.report_1 ;
>     GROUP BY Report1.Groupcode ;
>     ORDER BY I_L ;
>     INTO CURSOR SummaryTable
>HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform