473,804 Members | 2,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referring to last day's cost.

Hi,.

I'm trying to make a inventory and average cost that includes receivied
weights and cost.
The cost changes everytime we receivie product as cost from vendor
changes every time.

Everyday I would get a average cost depending on a calculation..an d the
tricky part will be getting the last day;'s received cost.

for example
DATE Weight Cost Average Cost
12/10/06 1000 3.13 3.13
12/11/06 1232 3.14 3.16

now to calculate next day's average cost I need to get 3.16

my question is do I need to write a procedure that after calculation
write the average cost to the table for that day?

thanks,

Dec 13 '06 #1
1 1243

ce**********@gm ail.com wrote:
Hi,.

I'm trying to make a inventory and average cost that includes receivied
weights and cost.
The cost changes everytime we receivie product as cost from vendor
changes every time.

Everyday I would get a average cost depending on a calculation..an d the
tricky part will be getting the last day;'s received cost.

for example
DATE Weight Cost Average Cost
12/10/06 1000 3.13 3.13
12/11/06 1232 3.14 3.16

now to calculate next day's average cost I need to get 3.16
Why? The next day's average cost will be

Sum(Weight*Cost ) / Sum(Weight)

for all three days. The average cost for the previous day is not
required.

Dec 13 '06 #2

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

Similar topics

10
7304
by: JL | last post by:
To All, I have a SQL2KSP3a database(<1GB) running on a 4x3GB physical CPU with 4GB of ram. It is Windows Server 2003 with hyper-threading turn on. There are ~420 .Net users/cxns (fat client, no web/app servers) with connection pooling and ~1 trx/sec. The database growth is neglegeable and actually is not even relevent which I will explain in a minute. 99% of the trxs are from one SP that does a select. The resultsets are relatively...
13
3623
by: SimonC | last post by:
I would like to return data from the last 2 weeks of each given month in Javascript, but in 2 formats. So, the penultimate week (Monday to Sunday) and the last week (Monday to ??) I'm not sure if it can be done, but all help welcomed. E.g. I have December and would like to see the last 2 weeks.. So this doesnt mean the last 15 days. What i mean by this is...
3
63116
by: Gol Yass | last post by:
Dear Newsgroup, Is there a function in Access XP to take a date or month , and return the last day in that month? Ex: the last day in september is 30 or the last day in May is 31 . Thank you very much, Gol
6
35938
by: Robert | last post by:
What's the best way in vba code to get the last day of the month for a given date, i.e. 12/01/2004 gives 12/31/2004 12/14/2004 gives 12/31/2004 12/31/2004 gives 12/31/2004 ? Robert
2
12049
by: Sasidhar Parvatham | last post by:
Hello All, Is there a way I can get dates for first and last fridays of a month? Any suggestion would be helpful. Thanks.
4
48222
by: laredotornado | last post by:
Hi, Using PHP 4, if I have a date, what is a function I could use to give me a date that represents the first day of that month? For example, if my date were "3/19/2006 8:00", I would want my function to return "3/1/2006 8:00". Similarly what function would I use to return the last day of the month? In the above example, the output I would want returned is "3/31/2006 8:00". Thanks, -
60
5069
by: Dave | last post by:
I'm never quite sure whether to use "this." or not when referring to fields or properties in the same class. It obviously works just fine without it but sometimes I wonder if using this. consistently may make the code easier to understand for someone else, etc. Using "this." makes it immediately clear, for example, that the variable being referred to is a member of the same class and is not declared in the method as a local variable. ...
9
7357
by: David Trimboli | last post by:
On a couple of my pages http://www.trimboli.name/rune/goblinmagic.html http://www.trimboli.name/rune/labyrinth.html I've got a number of definition lists concerning "Points Spent" and "Points Earned." A style sheet http://www.trimboli.name/rune/section.css makes the list definitions inline and adds "; " after each one (under "Encounter costs and mechanics" in the style sheet).
0
2366
by: marlberg | last post by:
Platform: Windows2000, WindowsXP, Windows Vista, etc Language: C#, ASP.NET Pre-compiled Libraries: Enterprise Library 3.0 full I have a requirement to implement in and display in C# and ASP.NET a DataGrid with Updatable rows based on a date retrieved from a data table in SQL Server. Below is the design algorithm. 1. Retrieve the Max(rundate) From MyDataTable 2. If the current month -1 = rundate .month from step 1 then 2a. ...
0
9714
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10346
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10090
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7635
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.