Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make such query?
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01080746
Message ID:
01080760
Views:
17
What seems to be a problem?

>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...
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform