Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make such query?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How to make such query?
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01080746
Message ID:
01080746
Views:
56
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
Next
Reply
Map
View

Click here to load this message in the networking platform