Hello
i have a table with some products. in the table i have two fields called itemIn ( buy) and Item out( sold).
now i want to calculate how many items with the same serial number or with the same id i have in stock.
example
ID date serial number ItemIn ItemOut Stock
1 20.05.2017 test1 55 20 35
i know how to calculate that
but lets say that another day i get new items with the same serial number
how to create field that will take the value from previus field and sum the new items so that i will have correct sum in the stock?
example
ID date serial number ItemIn ItemOut Stock
1 21.05.2017 test1 100 0 ?
correct way shuld be... the value from the stock and the new items that arrieved today
so the results shuld be 35+100 = 135, my new value of the items should be 135.
also i want if i sold some items that my value in the stock should change
exapmle
ID date serial number ItemIn ItemOut Stock
1 21.05.2017 test1 100 50 ?
the results should be 35 from stock +100 new items = 135 and 50 sold today ..the new value in the stock should be now 85
thanks in the advance
ID date serial number ItemIn ItemOut Stock
1 21.05.2017 test1 100 50 85
Elena
Try -
Nz(DSum("ItemIn", "MyTable", "Serial Number = " & Chr$(34) & [Serial Number] & Chr$(34))) - Nz(DSum("ItemOut", "MyTable", "Serial Number = " & Chr$(34) & [Serial Number] & Chr$(34)))
-
Where "MyTable" is the name of your table
Phil
8 1557
Can you please clarify what you mean by "with the same serial number or with the same id"
In your examples, ID = 1 has Serial Number "Test1". Is this always the case or could ID = 1 have a Serial Number "Test999"?
Phil
well with my serial number i mean that the serial number has to be the same, and ID is chaning
example
ID Serial number
1 test1
2 test1
3 test1
4 test2
5 test3
6 test2
7 test3
8 test2
9 test4
10 test5
So am I correct in assuming the ID is irrelevant and you want to do your calculation purely based on the Serial Number?
Phil
yes that is correct
i try with query but i dint get the sum for the same serial number
Elena
Try -
Nz(DSum("ItemIn", "MyTable", "Serial Number = " & Chr$(34) & [Serial Number] & Chr$(34))) - Nz(DSum("ItemOut", "MyTable", "Serial Number = " & Chr$(34) & [Serial Number] & Chr$(34)))
-
Where "MyTable" is the name of your table
Phil
hello
i try but says me that i miss some operator
i think is missing some " or ), [, ] but i dont know where
Can you please post back your code (Copy it directly)
Thanks
Phil
hello
i resolve everythink. thank you very much
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Niy |
last post by:
what does that mean? what for? I searched a lot but
failed to find explanation.
Sometimes I really have difficulty finding documentation
for some views.
|
by: tom |
last post by:
Hi,
How do I get the serial number of the harddisk in .NET?
I want this to be the same number even if the user has
reformatted, so I do not want the volume serial number.
Thanx,
t
|
by: |
last post by:
Hi,
Do memory sticks have serial numbers like harddrives? If so how can I get
this, I want to uniquely identify a memory stick (removable drive) for
authentication.
Thanks
|
by: Klaus Bonadt |
last post by:
In order to protect software from being copied without licence, I would like
to use something like a key, which fits only to the current system. The
serial number of the CPU or the current...
|
by: Nebojsa4 |
last post by:
Hi.
First, sorry on my weak English to all.
Qusetion:
How to read (in VB) Manufacturer serial number of Hard disk drive?
Not volume/serial number of C:, D:, etc. partitons.
For reading...
|
by: chandru8 |
last post by:
hi every body
i need a logic , that
for a particular code i need to genrate a serial number for a day should be one
for the next day it should be increment to 2 like this
can any one help me...
|
by: rajsrmc |
last post by:
Hello Guys!
I have a mysql table which is connected with aspx page in grid view, in the connected table i have assigned Serial number column as Primary key and as well in auto increment, by using...
|
by: Airslash |
last post by:
Hello,
I've written a class that resembles a hard drive. I'm already able using the Windows API to get information such as the remaining free bytes, the sectors and clusters,a nd it all works...
|
by: Keshia |
last post by:
I have a database that is for keeping track of inventory. I need to have my form for entering new inventory to automatically make a new serial number based on the category of the new item.
The...
|
by: muhammadayub77 |
last post by:
Hi
I am using ms access 2013. Often in my organization an excel sheet with the data needs to be imported in ms access for official use. While creating reports before that i want a table to have a...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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...
|
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: 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...
| |