Skip to main content

i need to implement datdiff function as following. How can i recieve the value of duration in a field like 01  duration  pic 9(05).

SELECT DATEDIFF(SECOND ,PulsZeit,getutcdate())
AS 'Duration'
FROM Clients
where AnwendungsId='Thomas Grausgruber@IBOS.TG007'

i need to implement datdiff function as following. How can i recieve the value of duration in a field like 01  duration  pic 9(05).

SELECT DATEDIFF(SECOND ,PulsZeit,getutcdate())
AS 'Duration'
FROM Clients
where AnwendungsId='Thomas Grausgruber@IBOS.TG007'

The following works for me:

01 myresult pic 9(13) value 0.                              

    move 1 to Employees-EmployeeID                          
    EXEC SQL                                                
     SELECT DATEDIFF(SECOND, BirthDate, HireDate)           
        as 'duration'                                       
     INTO                                                   
        :myresult                                           
       FROM dbo.Employees                                   
      WHERE ( EmployeeID = :Employees-EmployeeID )          
    END-EXEC                                                

i need to implement datdiff function as following. How can i recieve the value of duration in a field like 01  duration  pic 9(05).

SELECT DATEDIFF(SECOND ,PulsZeit,getutcdate())
AS 'Duration'
FROM Clients
where AnwendungsId='Thomas Grausgruber@IBOS.TG007'

Thank you very much - i works.