Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
thiruna
Starting Member
41 Posts |
Posted - 2001-10-26 : 16:25:11
|
| dear friends,i have a table (salesdetails) which has got the following fields......sales_id (auto incrment)Product_item intdate_time datetime (to store date and time)opening_stock int (contains the qty of items for that day)closing_stock int (contains the qty of items at the end of the day)Total_sales int (i have put a formula for this field (opening_stock - closing stock)The data entry for this table is not restricted to one per day. Any number of entries can be made on same day. I mean sales details at 26/10/2001 9.00 then at 26/10/2001 14.00 then at 26/10/2001 17.30 etc...I am using a ASP page for data entry. The following are questions i would like to clarify ....1. How could i retrive the last entered record for the particular product..?i have an idea of storing the last entered record in a seperate table and retrive it while adding new record for cross checking (i.e. closing stock of currently entered record should be greater than last entered record for the particular product.). But when i delete the last entered record, i cant able to retrive the values for cross checking... What would be best method to solve this....is my logic is correct or suggest me some good solutions...... 2. is it good to practice to allow users to delete or update sales records once added in to the table. becox if it gets modified, then all consequent records should get changed becox of opening and closing stock. what will be best option....?Please advice & suggetst some good solutions for my above questions.....?many thanks in advancethiruna@vsnl.com |
|
|
|
|
|