By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,163 Members | 944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,163 IT Pros & Developers. It's quick & easy.

very tricky sql statement

P: n/a
Hi all

First of sorry that I'am posting in the wrong group
But you guys and girls a very good with SQL statements
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"


Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.