Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 466.6k

how to use sql query for optimizing application

May 18 2021 12:52 PM
Hi Team
 
I have a query that checks for units being read and misread. Now the query works fine, how will implement this query to be readable to people in the existing application(windows application)? I was advice that using store procedured to the database table will break this windows application completely.
 
// Requirement
  1. The production shift leader(s) are finding that the total is not reflecting the correct number of units processed at the end of lego line and need to have a check in place to validate the units counted
  1. SELECT TOP 1000   
  2.       [Production Year]  
  3.       ,[PNR]  
  4.       ,[KNR]  
  5.       ,[Transaction Code]  
  6.       ,[DateTime Passed]  
  7.       ,[EQS Carstate]  
  8.       ,[SeqNum]  
  9.   FROM [Tracking_Server_DB].[dbo].[Checkpoint Movement]  
  10.   WHERE [Transaction Code] like '%T0013' and  
  11.   [DateTime Passed] between '2021-05-11 06:00:00' and '2021-05-11 19:59:59'  
  12.   and PNR not in   
  13.   (SELECT PNR   
  14.   FROM [Tracking_Server_DB].[dbo].[Checkpoint Movement]   
  15.   WHERE [Transaction Code] like '%T0067%' and  
  16.   [DateTime Passed] between '2021-05-11 06:00:00' and '2021-05-11 19:59:59')  
  17.   Order  by [DateTime Passed]  
// Output of this query is as image.
 

Answers (1)