03Explorer
Technical User
I am trying to make a variable driven code that the user enters criteria at the top of the SQL code and the output is custom driven.
Example:
This is a simplified snipit of the code I am trying to make more dynamic.
Example:
Code:
DECLARE @StartDate DATETIME SET @StartDate = '2009/01/01 00:00:00'
DECLARE @EndDate DATETIME SET @EndDate = '2009/05/20 23:59:59'
DECLARE @APPLICATION VARCHAR(3) SET @APPLICATION = 'PRV'
DECLARE @ELEMENT1name VARCHAR(100) SET @ELEMENT1name = 'MemberID'
DECLARE @ELEMENT1 VARCHAR(100) SET @ELEMENT1 = 'PatID_ValidIDPrompt'
DECLARE @ELEMENT2name VARCHAR(100) SET @ELEMENT2name = 'Total_Calls'
DECLARE @ELEMENT2 VARCHAR(100) SET @ELEMENT2 = 'PatID_Silencer'
SELECT
apname as @application,
table2.elemname as @ELEMENT1name,
table1.elemname as @ELEMENT2name,
@ELEMENT1 / @ELEMENT2 as 'percentage'
FROM
...
This is a simplified snipit of the code I am trying to make more dynamic.