Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
All records from one table and matching from other?
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
All records from one table and matching from other?
Divers
Thread ID:
00603273
Message ID:
00603273
Vues:
67
I have two tables. First table is called ctStatus. It contains a list of defined status codes:
statusid   statusdesc     isactive
--------------------------------------------------
 1         enter room        1
 2         exit room         1
 3         arrive            1
 4         depart            1
The second table contains status by meetingnumber. The user would click on a status to assign it to a meeting it's called ctPatStatus
patstatusid   meetingnumber  statusid  statustime  
---------------------------------------------------------
1                1             1        02/10/2002 17:00
1                1             2        02/10/2002 18:00
What I want to be able to do is create a cursor that I can present to the user that displays all the available events, and beside the events that have a datetime show that, otherwise show a null.

So, based on the above data, the cursor I would would get would look something like:
enter room       02/10/2002 17:00
exit room        02/10/2002 18:00
arrive           NULL
depart           NULL
The following this the vfp code I have tried:
SELECT dbo.costatus.statusid,dbo.coStatus.statusdesc,  
       dbo.coPatStatus.statustime 
FROM dbo.coStatus LEFT OUTER JOIN 
     dbo.coPatStatus ON dbo.coStatus.statusid = dbo.coPatStatus.statusid 
WHERE coPatStatus.meetingnumber=?gnMeetID 
But I get no results once I put the where clause. If I leave the where cluase off, I all the events and matching ctPatStatus records, but not limited to the ones I need.

Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform