Quantcast
Channel: SCN : Unanswered Discussions - Semantic Layer
Viewing all articles
Browse latest Browse all 1291

Invalid prompt Error in derived table

$
0
0

hello All,

 

I have the below query which works in SQL server...but the same query in derived table is giving invalid prompt error when instead of hardcoding the value...I gave  @prompt for user input value.

 

 

SELECT

  convert(varchar(6), dateadd(MM,-3, convert(datetime, substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 5,2) + '/' + '30' + '/'+ substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 1,4))), 112) as prequarter,

  Primed_Status,

  EHR

FROM

  EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE

 

 

  where RPT_YEAR_MONTH = '201406'

Untitled1.png

 

SELECT

  convert(varchar(6), dateadd(MM,-3, convert(datetime, substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 5,2) + '/' + '30' + '/'+ substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 1,4))), 112) as prequarter,

  Primed_Status,

  EHR

FROM

  EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE

 

 

  where RPT_YEAR_MONTH = @Prompt('Enter values for Rpt Year Month:','N','Folder\MeasurePractice\Rpt Year Month',Mono,Constrained)

 

Thanks in advance for any inputs.

 

Regards.


Viewing all articles
Browse latest Browse all 1291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>