Here is my SQL string:
"SELECT to_ordnum, to_orddate," _
& "(SELECT SUM((DDPROD.pr_ stanmat * DDPROD.pr_prfac t) *
(DOBOM2.b2_quan t * DDORD.or_quant) ) FROM DDPROD INNER JOIN DOBOM2 ON
DDPROD.pr_prodn um = DOBOM2.b2_prodn um INNER JOIN DDORD ON
DOBOM2.b2_orid = DDORD.or_id INNER JOIN DDTORD ON DDORD.OR_TOID =
DDTORD.TO_ID WHERE DOBOM2.b2_ordnu m = ''order number here from result
of outer select) AS Total" _
& "FROM DDTORD WHERE to_trak2id IN (39, 40, 41) AND to_ordtype = 's'
AND to_status = 'c' GROUP BY to_ordnum, to_orddate ORDER BY to_ordnum
DESC"
The outter Select statement returns various amounts of order numbers
represented by 'to_ordnum' in the outer Select clause which has to
meet the critera in the outer WHERE clause. I would like to place
these numbers selected into the inner WHERE clause for the inner
select statement where DOMBOM2.b2_ordn um = ?the order selected by
outer select statement.
I have tried placing to_ordnum into that location but the SQL2000
server does not process it.
Any suggestions, ideas?
Thank you,
Brett