Hi all

Got a very tricky sql statement, and I've been pulling my hair to boldness.
I need to make a comparison between 2 values

2 tables

2 columns

SS=security stock
Forradssaldo=actual stock (Swedish)

SS i tblMaster is unique i that table, just one value
Forradssaldo has several value's per week

I want to compare(see) if SS is less than the SUM of Forradssaldo for the last week
and then show all Artikelnr that are less

tblData.InfogadVecka=inserted week (again Swedish)

' ' What I showed when I clicked on a article number(Artikelnr)
' strSQL2 = "SELECT SUM(Forradssaldo) AS FSaldo, SUM(Forradsvarde) AS FVarde, InfogadVecka" & _
' " FROM tblData WHERE Artikelnr= " & frmMain.lstArtikelNr.Text & " AND InfogadVecka BETWEEN " & _
' GetSetting(App.Title, "Settings", "StartDatum") & " AND " & GetSetting(App.Title, "Settings", "SlutDatum") & _
' " GROUP BY InfogadVecka"