Solved

Sql query not working properly

  • 7 March 2024
  • 6 replies
  • 170 views

Badge +6

following query works with excel.what is suppose do is after executing this query it should update value of $intCRMIncidentRequest$ in the excel sheet,query is working fine and correct
but sometimes execution takes place but this qurey does not update varible value in the excel sheet.
as this issue happens sometimes i am not able to find the reason or solution of this issues 
can anyone help me with issue

UPDATE [Sheet1$$] SET [Status] = '$intCRMIncidentRequest$' WHERE Trim([Txn_Posted_Date])='$strTransactionDate$' AND UCase(Trim([Cr_Dr]))='CR' AND UCase(Trim([Description]))='$strTDesc$' AND [Transaction_Amount] = $intAmount$

icon

Best answer by Tamil Arasu10 12 March 2024, 14:28

View original

6 replies

Userlevel 6
Badge +15

Hi @dhavalmodi,

Double-check the values of the variables used in your query ($intCRMIncidentRequest$, $strTransactionDate$, $strTDesc$, and $intAmount$). If these values are not as expected, the query may not find any matching records to update.

Make sure that the data types match, and there are no leading or trailing whitespaces.

 
Badge +6

Hi @Tamil Arasu10 ,
Thank You for the response,
but we have already double checked values of this variables in some cases there was leading and trailing whitspaces so we have applied string replace logic and removed all the spaces and some special chars also but this did not solved the error we are facing
kindly check if you have any other solution that might help us to solve this issues. 

Badge +4

this can also happen due to file locking or concurrency issues. I have seen something similar so try ensuring its shared excel file. i.e. multiple people can update. Also kill excel at start to ensure its not locked from previous execution.

Badge

Hi @dhavalmodi - I will suggest you to check Transactiondate column. Sometime this column may react  according to the system date. for testing purpose, without using this column can try to update the values using the same query. 

Badge +6

hey @ShivC 
thank you for the response we have tried your solution but it did not work i am still facing the same issue.
kindly check if you have any other solution that might help us to solve this issues. 

Badge +6

hey @Nagarajan.s 
we have already checked this transaction date column is is working properly
still we facing this issue check if you have any other solutions

 

Reply