Forum Discussion

anatar02's avatar
anatar02
Contributor
13 years ago

how can we perform SELECT DATEDIFF query in testComplete in C#

hi, i am using testcomplete 8 with C#, i have a scenario where i need to execute the SELECT DATEDIFF commands and executed successfully without any errors but no value is return, just an empty value, could you please help me or advice me if i am using any  wrong syntax



Log["Message"](mConnection["Execute"]("SELECT DATEDIFF(Second,'" + Executed_Time_Started +"','" + Executed_Time_Ended +"')")); 
  • Thanks Tanya for you reply :) 



    I have done some works in DB using Testcomplete with C# but here the issue is quite diffrent.  the below line of code is working without any error but the issue is it is not returning any values



    Log["Message"](mConnection["Execute"]("SELECT DATEDIFF(Second,'" + Executed_Time_Started +"','" + Executed_Time_Ended +"')")); 








  • Hi Ashok,


     


    Execute returns a Recordset object. To parse it and post results to the test log, you need to use a way listed in the help topic I sent.


     

  • testuser11's avatar
    testuser11
    New Contributor
    hi,

    I am trying to pass sql query in test complete...

      Cmd.ActiveConnection = AConnection--->this statement doesnt seem to work!!!