JoshuaCMcMahon

Help with Switch Value in Where Statement

May 12th, 2025
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Original
  2. Select
  3.     id
  4.     ,team_lead as "Team Lead"
  5.     ,start_date as "Start Date"
  6.     ,lot as "Lot"
  7.     ,sku as "SKU Description"
  8.     ,production_step as "Production Step"
  9.     ,units_required as "Units Required"
  10.     ,status as "Status"
  11.     ,units_completed as "Units Completed"
  12.     ,...
  13. From glx."The New Plan"
  14. Where
  15.     team_lead != ''
  16.     And team_lead = {{Select_Team_Lead.selectedOptionValue}}
  17.     if {{switch_show_completed.isSwitchedOn}} = 'false' then status != 'Completed' end if;
  18.  
  19. Order By
  20.     start_date desc
  21.     ,lot desc
  22.    
  23.    
  24. --Revised
  25. Select
  26.     id
  27.     ,team_lead as "Team Lead"
  28.     ,start_date as "Start Date"
  29.     ,lot as "Lot"
  30.     ,sku as "SKU Description"
  31.     ,production_step as "Production Step"
  32.     ,units_required as "Units Required"
  33.     ,status as "Status"
  34.     ,units_completed as "Units Completed"
  35.     ,...
  36. From glx."The New Plan"
  37. Where
  38.     team_lead != ''
  39.     And team_lead = {{Select_Team_Lead.selectedOptionValue}}
  40.     {{if switch_show_completed.isSwitchedOn == false then "And status != 'Completed'"}}
  41.  
  42. Order By
  43.     start_date desc
  44.     ,lot desc
Advertisement
Add Comment
Please, Sign In to add comment