Solved

check the product change in mysql

Posted on 2006-11-15
2
148 Views
Last Modified: 2008-02-20

00001  0   2006-11-15 20:54:05
00002  2   2006-11-15 20:54:05
00012  4   2006-11-15 20:54:05
00001  4   2006-12-15 20:54:05
00002  3   2006-12-15 20:54:05
00003  2   2006-12-15 20:54:05

three colum above name code,onhand,time

how can I write code to caculate onhand  change  (if some code nohave onhand give it equal to 0)
00003  2
00002  1
00001  4
00012  -4   (if some code nohave onhand give it equal to 0)
0
Comment
Question by:teera
2 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 450 total points
ID: 17949219
I'm not even sure what you're asking.  It seems like you want the difference between 'onhand' found on two different dates, yet the example you gave there doesn't seem to reflect that?

If that is what you want, which two dates?  How many dates are listed for each item?  Do you want the difference between each pair, or just the difference from the earliest record to the most recent?
0
 

Author Comment

by:teera
ID: 17951930
Hi  VoteyDisciple
you are right that is the think I want can I use sql command only or I need to use php
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question