Gönderdiğiniz son örnekte kod hatalı yazılmış. Dsum ("[urun_uretim_toplam]";"TBL_stok_giris"........ şeklinde olması gerekiyor.
"urun_kodu_yunus" her iki tabloda da olduğu için hata veriyor. bunun yerine
Kod:
kod: urun_kodu_yunus
toplam üretim toplamı için kodun aşağıdaki gibi olması gerekli.
toplamurun_uretim_toplam: Dsum ("[urun_uretim_toplam]";"TBL_stok_giris";"[urun_kodu_yunus]=" & "'" & [kod] & "'")
sorgunun Sql kodunun tamamı ise aşağıdaki gibi olacak.
SELECT TBL_stok_giris.urun_kodu_yunus AS kod, Dsum ("[urun_uretim_toplam]","TBL_stok_giris","[urun_kodu_yunus]=" & "'" & [kod] & "'") AS toplamurun_uretim_toplam, Dsum ("[urun_sevk_toplam]","TBL_stok_cikis","[urun_kodu_yunus]=" & "'" & [kod] & "'") AS toplamurun_sevk_toplam
FROM TBL_stok_giris
GROUP BY TBL_stok_giris.urun_kodu_yunus;
Ayrıca; verileri Dsum kodu ile topladığımız için her iki tabloyu da sorguya eklemeye gerek yok.