Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Concantenated Conditional WHERE Clause
Message
De
03/08/2006 10:16:05
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Concantenated Conditional WHERE Clause
Divers
Thread ID:
01142698
Message ID:
01142698
Vues:
50
Trying to get a conditional WHERE clause to work in my SQL, but I can't seem to get the single/double quotes to work right. Basically, if the tPlans.PlanID = 7287, then I want to look at the web_PMEmp.ExecTitle field to determine the correct document name to match on. Any suggestions on another way to handle this welcome too.
PellaWhereClause = "AND IIF(tPlans.PlanID = 7287,'ALLTRIM(web_PlanDocs.cName) == IIF(web_PMEmp.ExecTitle = 'SA2','Plan Document - Executive SPP','Plan Document - Executive SPP')" + ",.T.)"

*-- Retrieve plan forms for all of the accounts the user is participating in	
     SELECT DISTINCT ;
          PADR(IIF(ALLTRIM(web_plandocs.cname) == 'PIN Form', "Plan Participant Web Access Form", web_plandocs.cname), 60) as cname, ;
          PADR(web_plandocs.mdesc, 250) as mdesc, ;
          web_plandocs.lscripted, ;
          web_plandocs.cfilename, ;
          web_plandocs.ntempltid, ;
          web_pmplan.planname, ;
          web_plandocs.planid ;
		FROM web_plandocs JOIN tplans ON tplans.planid = web_plandocs.planid ;
		JOIN web_pmplan ON web_pmplan.planid = web_plandocs.planid ;
		WHERE web_pmplan.nplancode = m.plancode ;
			AND web_plandocs.idnum = m.idnum ;
			AND web_plandocs.dtype = 1 &filter_PIN &PellaWhereClause ;
		ORDER BY web_pmplan.planname, web_pmplan.planid, web_plandocs.cname ;	
		INTO CURSOR tdoc
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform