473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

very tricky sql statement

Jon
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
tblData
tblMaster

2 columns
tblData.Forradssaldo
tblMaster.SS

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"
--

Regards
Jon

jo*************@comhem.se
Nov 12 '05 #1
0 1037

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
595
by: dracolytch | last post by:
Good day all, Ok, I have a pretty tricky problem that I need some help with. I pass around search query information a fair amount (specifically WHERE statements). Normally, I just rawurlencode()...
4
1898
by: Bung | last post by:
Hi, I have a tricky sql statment I have to write (tricky for me) and I am stuck. I'm having trouble with the following problem. Table1 (Column a, Column b, Column c) Table2 (Column a, Column...
3
1618
by: Martin | last post by:
Dear Group I wonder whether you can push me in a direction on how to design the following statement. I'm looking for a SELECT with some tricky ORDER BY. The database table looks like this: ...
13
2723
by: Steve Jorgensen | last post by:
== On Error Resume next, and Err.Number == If you want to call one of your procedures from another procedure, and check for errors afterward, you mayimagine that you should write code something...
6
1259
by: pointBoarder | last post by:
Thanks in advance to all who read this. I've got 3 tables which were created from a txt file dumped from some old system. Header ID -- autonumber, primary OrderNum -- field I want Line
21
364
by: Ike Naar | last post by:
Consider the following code: #include <stdlib.h> struct s { /* ... */ struct s * next; };
9
1710
by: nirkheys | last post by:
Hi all, I have been asked if the following is possible. i googled for it,thought a lot about it and decided that it is not possible,but i am posting it here in a hope of getting this problem...
11
1905
by: windandwaves | last post by:
Hi Folk I need to write a tricky replacement function. C = replace A with B in C C = replace D with E in C examples of A could be "a cat climbs a tree", examples of B could be
4
1411
by: Mysterydave | last post by:
Hi, Here is my problem: I have a report which lists Application numbers, Offer numbers and Firm Replies numbers for a subject i.e. Geography as 3 rows. My column headings also list subjects so...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.