473,395 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Item Ledgering

10
hey guys need a little help I'm creating inventory item in ms access just like the picture below there is a quantity, amount, total and balance I would want to multiply the quantity and the amount so I can get the total and the balance as well after I get the balance I will put a different amount to subtract in the balance the purpose of that I'm doing this is to monitor the balance. If there is a new item entry is the same way quantity multiply by amount equals total and balance and amount subtract balance again is just like a running subtraction but if there is a new item the current running subtraction will stop and a new entry will do the same way.


and this is the the query
Expand|Select|Wrap|Line Numbers
  1. SELECT t.*, (SELECT SUM(IIF(amount IS NOT NULL,amount,0))+ 
  2.                  SUM(IIF(balance IS NOT NULL,-balance,0))
  3.           FROM T t1 
  4.           WHERE t1.ID <= t.ID
  5.          ) AS balance
  6. FROM T;
thanks :)

Attached Images
File Type: jpg expected output.jpg (40.8 KB, 231 views)
Jul 13 '18 #1
3 1262
NeoPa
32,556 Expert Mod 16PB
There's so much wrong with this.
Junne:
I'm creating a item entry in ms access
What? What does that even mean? Forget the lack of any punctuation; "a item entry" just doesn't mean anything.

It's good that you've posted your existing SQL. It's not good that you seem to believe that's as good as writing out what you mean in English. The SQL isn't going to work so trying to work out what you mean (in the absence of a real question) doesn't seem possible.

You can probably hear my frustration coming out. We want to help, but you make it so difficult by paying so little attention to what you're asking. Let's see a proper job and, in turn, we'll see what we can do to help.
Jul 13 '18 #2
PhilOfWalton
1,430 Expert 1GB
I agree with Neopa. He is brilliant, but unfortunately not Psychic.

Just 2 quick thougts.
What do you want your expected output to look like after 1000 entries?

Why, when you state Qty = 0, do you reduce the stock as if the Qty was 1?

Phil
Jul 13 '18 #3
NeoPa
32,556 Expert Mod 16PB
PhilOfWalton:
but unfortunately not Psychic.
Well, some maybe. The point is I shouldn't be required to be to work out what the question is.
Jul 13 '18 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: tuvok | last post by:
I have an Item object which allocates memory in its ctor and frees it in its dtor. I want to add such items to a vector. But the program crashes. Why? How do I fix it? #include <vector> ...
2
by: Ash Jones | last post by:
I trying to do nested items in a collection. I've got an item which one of the properties is subitems, which is a collection of item. can do the root level but if i do a subitem at design time i...
7
by: Devron Blatchford | last post by:
Hi there, I have created an owner draw menu item using DrawItem and MeasureItem in VB.NET. This seems to work well. I was wondering how I can do mouse over effects in these menus. Basically the...
3
by: Dean Slindee | last post by:
In a checked listbox, I am allowing drag/drop of the items within (resequencing). Problem is, when dropping a checked item, the checked state always reverts to unchecked (unwanted). Anyone know...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
6
by: George | last post by:
Hi all, How can I get the value stored from the selected item and subitems of a listview? Thanks in advance, George
1
by: HKSHK | last post by:
Hi guys, I have a problem with the combo box I'm writing on. What I want is custom items, which are fine so far, but when I select one the combo box shows the project name...
3
by: Bmack500 | last post by:
I have a sub, and a class. The sub is like this: Sub dothis() Dim aInfoListX As New infoWrapperClass aInfoListX.params = ReadConfig() Dim sqlCMD As New SqlCommand aInfoListX.sqlCmd = sqlCMD ...
0
by: plomon | last post by:
Following is the system and software info Platforms: Windows XP and OSX Lion Activestate Python 2.7.2 wxPython2.9-osx-cocoa-py2.7 (for OSX) wxPython2.9-win32-py27 (for Windows XP) I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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...

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.