A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.
DROP Table if exists TEMP_PARTS; CREATE TABLE TEMP_PARTS(SELECT il.PartDesc as 'Tool Type', il.PartNumber, ip.Quantity, CAST('2012-01-01 12:00:00 AM' AS DATETIME) AS 'InsertDate', ip.InventoryListID, ip.locationID FROM Inventory_Parts as ip JOIN Inventory_InventoryList as il ON il.UID = ip.InventoryListID WHERE LocationID = 1 and isVisible = 1); UPDATE TEMP_PARTS tp ///////I was thinking maybe it would be an if statement here ?? ///////////////////////////////////// /////// if max(InsertDate ) IS NOT NULL ELSE (SKIP) Set tp.InsertDate = (select max(InsertDate) from Inventory_PartsHistory WHERE InventoryListID = tp.InventoryListID AND locationID=tp.LocationID); SELECT * FROM TEMP_PARTS Where InsertDate BETWEEN '2012-01-01 12:00:00 AM' AND '2014-12-13 12:00:00 AM';