Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have three sql data table. 1. products which contains data about how many products is now 2. income table contains product income quantity and date information and last table contains sold product data.

How i can make to show user how much current products was yesterday or two days later or 1 week, or 1 month.

does it good way to make new table which will save product current quantity after day end?

Does this method works correctly?
thanks.
Posted

I Think you are trying to create sales system. If it is that you can follow Northwind database sample with access database or you can find it in google.


Thanks,
Mamun
 
Share this answer
 
Try:
SQL
SELECT * FROM myTable WHERE purchaseDate BETWEEN @STARTDATE AND @ENDDATE
If you hand the two dates as parameters, and remember that BETWEEN is inclusive, then make STARTDATE yesterday at 0:0:0 and ENDDATE yesterday at 23:59:59 that should do what you want.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 8-Aug-11 7:45am    
Me thinks you missed that OP wanted the current stock count of each product.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900