As Ak

As Ak

  • NA
  • 65
  • 7.8k

Display the latest updated data

Oct 11 2020 9:25 PM
I have to display the data that currently being update. The problem is, I'm using the CONVERT function for the columns that i need to display. 
 
This is my code for fetch the data with status 'New'. This code is before updating the status. 
  1. SELECT CONVERT(varchar(10), Start_RG, 2) AS Start_RG, CONVERT(varchar(10), End_RG, 2) AS End_RG FROM RG WHERE Status = 'New'
This is the code for updating the status to 'In Use'
  1. UPDATE TOP (1) RG SET Status = 'In Use' OUTPUT deleted.Start_RG, deleted.End_RG, deleted.Status WHERE Status = 'New'
How can i fetch the Start_RG and End_RG that currently updated the status to In Use

Answers (5)