How would I write the SQL to update a record that has the most recent date?

Say I want to change the status field to "Approved" where the date is the most 
recent and SKU = 12345

Will the Max function work in the Where section of the SQL or is there another 
function to use to find the most recent date?

UPDATE table 
SET STATUS = 'approved',
WHERE SKU = #URL.SKU# AND MAX(StatusWhen)


Thanks,
Chad



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:243195
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to