Habe noch bissel probiert und habe die Lösung gefunden.
Code:
Select Bauteil, sum(Menge) as Menge from
(SELECT t1.pid,t1.ff_name,t1.value as Bauteil,t1.tstamp as Datum,
(SELECT t2.value FROM `tl_formdata_details` as t2
Where t1.pid=t2.pid and t2.ff_name in ('menge_bauteil1')) as Menge,
(SELECT t3.value FROM `tl_formdata_details` as t3
Where t1.pid=t3.pid and t3.ff_name in ('lfd')) as Vorgang
FROM `tl_formdata_details` as t1
Where t1.ff_name in ('bauteil1')
) as tempT
Where convert(Vorgang, decimal) between "2281" and "2308"
group by Bauteil
order by Menge desc
Das dicke und unterstrichene ist die Lösung, ich hoffe ich kann damit auch anderen helfen.
Lesezeichen