pblevins10
New member
- Joined
- Dec 14, 2009
- Messages
- 3
- Programming Experience
- 3-5
Hello All,
I have the following SQL query that runs against an Excel datasource and I'm getting the infamous "No value given for one or more required parameters" because of a join. It's erroring on the where t1.[trnVendorName] = v.[Vendor] part. It is acting like it can't see the outside query. Any thoughts? This is finding the median of a value by the way.
Thanks in advance.
Code:
I have the following SQL query that runs against an Excel datasource and I'm getting the infamous "No value given for one or more required parameters" because of a join. It's erroring on the where t1.[trnVendorName] = v.[Vendor] part. It is acting like it can't see the outside query. Any thoughts? This is finding the median of a value by the way.
Thanks in advance.
Code:
Dim strSubmittalRatesSQL = "select distinct v.[Vendor]," & _
"(select MAX([rate1]) FROM (" & _
"select top 50 percent ((t1.[MaxSubmittaltrnBillRateST]-t1.[POAvgOrigBillRateST])/t1.[POAvgOrigBillRateST])*100 as [rate1] " & _
"from [Sikorsky_Submittal$] t1 " & _
"where t1.[trnVendorName] = v.[Vendor] " & _
"and t1.[POAvgOrigBillRateST] is not null " & _
"order by ((t1.[MaxSubmittaltrnBillRateST]-t1.[POAvgOrigBillRateST])/t1.[POAvgOrigBillRateST])*100 asc " & _
") h1) + " & _
"(select MIN([rate2]) FROM ( " & _
"select top 50 percent ((t2.[MaxSubmittaltrnBillRateST]-t2.[POAvgOrigBillRateST])/t2.[POAvgOrigBillRateST])*100 as [rate2] " & _
"from [Sikorsky_Submittal$] t2 " & _
"where t2.[trnVendorName] = v.[Vendor] " & _
"and t2.[POAvgOrigBillRateST] is not null " & _
"order by ((t2.[MaxSubmittaltrnBillRateST]-t2.[POAvgOrigBillRateST])/t2.[POAvgOrigBillRateST])*100 desc " & _
") h2) " & _
"as [SubmittalRates1] " & _
"from [Sikorsky_Vendors$] v"