Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excluding Parents without children
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00176004
Message ID:
00176011
Vues:
40
>I have two listboxes with RowSourceType set to SQL. The first listbox shows available parents while the second shows the children of the selected parent that are associated with the local station. I want to modify the SQL statement of the first box so it does not show items that don't have children. Here are the SQL statements:
>
>First ListBox:
>SELECT taskID,task ;
> FROM tasks ;
> ORDER BY task ;
> WHERE (active = .T.)
> INTO CURSOR curTasks
>
>Second ListBox:
>SELECT subID, subTask, taskID ;
> FROM subTasks ;
> ORDER BY subTask ;
> WHERE ( taskID = curTasks.taskID .AND. ;
> active = .T. .AND. ;
> labName = Thisform.labName ) ;
> INTO CURSOR curSubTasks
>
>This works except that the first listbox will show items that don't have any children. How do I exclude these? Thanks.
>
>Mon

Add to the first SQL (parent) the following AND condition to the where clause

AND taskid IN ( select distinct taskid from SubTask )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform