Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to join tables with a condition if field is empty
Message
De
22/06/2009 23:12:27
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to join tables with a condition if field is empty
Divers
Thread ID:
01407723
Message ID:
01407723
Vues:
115
I have this query


SELECT userID, swipedate, MIN(SwipeTime) AS Time2 ;
FROM temp WHERE VAL(swipetime) BETWEEN 1200 AND 1300 AND eventid='OUT' ;
GROUP BY userID, swipedate ;
INTO CURSOR c_LunchOut



There may be cases when an employee time-outs early, say 11:30.. leaving empty records on this query since I put the between 1200 and 1300 condition.. so I put another query on my form..


SELECT userID, swipedate, MAX(SwipeTime) AS Time2 ;
FROM temp WHERE eventid='OUT' AND VAL(swipetime) < 1200;
GROUP BY userID, swipedate ;
INTO CURSOR c_AMUndertime



I'd like to join these two tables with a condition that if TIME2 on c_LunchOut is empty, the record on c_AMUndertime will be used or saved in that table..

How should I do this?

Pls help. TIA.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform