Skip to main content
Solved

Sql query not working properly


Forum|alt.badge.img+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$

Best answer by Tamil Arasu10

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.

 
View original
Did this topic help answer your question?

6 replies

Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+16
  • Most Valuable Pathfinder
  • 3274 replies
  • Answer
  • March 12, 2024

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.

 

Forum|alt.badge.img+6
  • Author
  • Navigator | Tier 3
  • 31 replies
  • March 13, 2024

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. 


Forum|alt.badge.img+4
  • Navigator | Tier 3
  • 36 replies
  • March 14, 2024

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.


Forum|alt.badge.img
  • Cadet | Tier 2
  • 1 reply
  • March 14, 2024

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. 


Forum|alt.badge.img+6
  • Author
  • Navigator | Tier 3
  • 31 replies
  • March 14, 2024

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. 


Forum|alt.badge.img+6
  • Author
  • Navigator | Tier 3
  • 31 replies
  • March 15, 2024

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

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings