Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Color Coding
Message
De
13/01/2000 02:10:32
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
12/01/2000 16:39:57
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Divers
Thread ID:
00317023
Message ID:
00317421
Vues:
9
>Cetin,
>
>This works. However, if you remember I have a one to many relationship. My report lists the main EDR number and the the specific number of submittals for each EDR. So I have
>
>12345
>
> 1
> 2
> 3
>I either need a way to check the last submittal in the report. O better yet a SQL statement the produces a report of the EDR numbers with the last sumittal listed only. Can You Help with an SQL statement.
>
>God Bless,
>S. Dyke


Steve,
As far as I remember your last submittal either had its date field non-empty or had the latest date within those submittals (belonging to same edr_no) :
* If you don't want those parent edr_no that don't have submittals at all
* then make it INNER join instead of LEFT
* SQL getting all
select * from myParent ;
  left join myChild on myParent.edr_no = myChild.edr_no

* SQL getting all ordered by Submittal dates (descending)
select myParent.edr_no, myChild.edr_subno, myChild.dSubmitted, ... ;
  from myParent ;
     left join myChild ;
        on myParent.edr_no = myChild.edr_no ;
  order by 1,2,3 descending
* Ordered on edr_no and edr_sub_no ascending, dates descending
If you would just report those with last submittal date then you don't even have a need to use SQL.

index on padl(edr_no,8,"0")+padl(edr_subno,8,"0")+dtos(dSubmittalDate) ;
tag byLstSub descending
select myParent
set relation to padl(edr_no,8,"0") into myChild
report form byLastSubmittal
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