Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make such query?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How to make such query?
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01080746
Message ID:
01080746
Vues:
58
Hi everybody,

Here is my present code
text TO lcSQL TEXTMERGE NOSHOW PRETEXT 7
			trans.*, ;
			Trans_Employees_Queues.* ;
			from trans INNER join Trans_Employees_Queues ;
			on trans.cTrans_pk = Trans_Employees_Queues.cTrans_fk ;
			<<m.tcJoin>> ;
			where trans.cDepartment_Code like '<<this.cDepartment_code>>' ;
			and trans.cResolution_Codes_fk is NULL 
	ENDTEXT

	lcSQL = "SELECT " + IIF(not EMPTY(m.tnTotalNumber), ;
		"TOP " + TRANSFORM(m.tnTotalNumber)+ " ","") + ;
		m.lcSQL + iif(not empty(m.tcWhere), ;
		" AND " + m.tcWhere,"") + ;
		" order by trans.tDate_Received"
However, there is a problem. There could be records in Trans_Employees_Queues for "FORCED" queue. In other words, for these cases we create additional records in Trans_Employees_Queues table and then use Employee_Queue_Schedules table to assign them. Now, obviously I do not want to assign records which are already in the FORCED queue. Do you see a way to amend this query?

Thanks a lot in advance.

In other words, I need the same query, but with

and Trans.cTrans_fk not in (select cTrans_pk from Trans inner join Trans_Employees_Queues on ... inner join Employee_Queue_Schedules ...
)


But the inner select should satisfy the same conditions as my outer select...
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform