Update in table with date field

1

Hello! I need to do an update on a table. I have some sort of chat in the bank, where it records the time the conversation was started, and should record the time it ended.

However, before I implemented the code that would record in the bank the end time, it was getting null as I tested. So I need to update the table to replace these fields.

The problem is that I have many attendance records with final NULL , and I need to make a update based on the day of that conversation. Here is an example of select of table CHAT : select * from CHAT where HR_FIM is null

   ID     NOME                HR_INI                             HR_FIM 
   --     ------------        -----------------------            -----------------------
    4     Elisa               2015-04-10 17:39:50.875            NULL  
   13     Jorge               2015-04-10 18:08:33.958            NULL
   18     João                2015-04-10 18:34:44.794            NULL
   23     Sergio              2015-06-28 16:33:25.357            NULL

I can not make a update because, as I would need to collocate exact values for certain days, I could not simply give where HR_FIM is null . I tried to do some conversions that I found on the internet, and it also did not work.

Thank you.

    
asked by anonymous 08.07.2015 / 17:06

1 answer

-1

Boy, are there so many records like that? Because I would suggest you make a UPDATE CHAT SET HR_FIM = "data" WHERE ID="id" and HR_FIM IS NULL . That is, manually for each ID that has null HR_FIM.

But take a question, are these values just for testing?

Because another solution would be to make an UPDATE with the current system time, where all HR_FIM are null. Because it would guarantee the completion of these null, and break values with dates after HR_INI.

    
08.07.2015 / 17:27