r3nder
asked on
ON DUPLICATE KEY UPDATE IF
I am trying to insert or update depending on criteria. On the update I want to make sure before the update if (one Datetime value is < than the other Datetime value. then update - if not - dont do anything how do I do that
INSERT INTO Temp_MyTools(Select 0 as 'id', ToolType,SerialNumber,MAX(UploadDate) as 'FUploadTime', Cast('2012:01:01 12:00:00 AM'as DateTime) AS 'HUploadTime', LocationID as 'DefaultLocationIndex', 1 as 'Qty' FROM Inventory_SerializedAssets Where LocationID in('" + locationIndex + "') GROUP BY SerialNumber) ON DUPLICATE KEY UPDATE IF(FUploadTime <VALUES(FUploadTime)), FUploadTime = VALUES(FUploadTime);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER