I have a database that runs a query every month for storage charges. If the material has not been shipped (there is a shipped date) then I want to charge for storage. There is a date in field that I use as a reference to calculate from. The item comes it, we log it. The first 30 days are free. So I create a storage date of datein +31. He is working off of 30 days only…. he also charges for an entire month even if it is only stored for 3 days. My problem is that I run the query based off of datein – I have to check for unloading charges as well. So, I look at datein and add 31. When run the query, I check to see if storage date is between the query range, if it is charge for storage. If not, bypass that charge. No charge this month, but i need to increase the storage date to another 31 days. How to I increment the storage date again every 31 days. So if I run again, the storage falls within this month, charge for storage, increase again. Run for next month, check again…etc until they ship it.
I hope this makes some sense. I am creating an invoice.