I am passing a bunch of parameters to my stored proc. The following query uses a few of those parameters alongwith a column value from the outer table using cross apply. I get a compilation error "Incorrect Syntax near B1". this is in the From Clause. Please note that it is the last parameter in the function call - SELECT
-
ContractId = @ContractId, BusinessUnitId = B1.BusinessUnitId, B1.ServiceId, B1.CampaignId,
-
TotalCount = F1.TotalCount,
-
EligibleCount = F1.EligibleCount,
-
UnitPrice = F1.UnitRate,
-
TotalPrice = Convert(decimal(20,10),0.00),
-
BusinessUnitExpenseId = NULL,
-
IsFixed = CONVERT(bit,'False'),
-
FixedAmtDealType = CONVERT(varchar(3),''),
-
ShowFixedAmtDealType = @ShowFixedAmountWithDealType
-
INTO
-
#TempAccountDetails
-
FROM
-
BusinessUnitAccountingSummaryData AS B1
-
CROSS APPLY dbo.func_GetServiceContractFigures(@StartDate, @EndDate, @Service, @BUId, B1.CampaignId) AS F1
-
WHERE
-
B1.ServiceId = @Service
-
AND B1.BusinessUnitId = @BUId
-
AND B1.Date BETWEEN @ContractStartDate AND @ContractEndDate
-
GROUP BY B1.ServiceId, B1.CampaignId, B1.BusinessUnitId
0 1609 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: Preston Landers |
last post by:
Hello all.
I am trying to write a query that "just" switches some data around so
it is shown in a slightly different format. I am already able to do
what I want in Oracle 8i, but I am having...
|
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: Steve |
last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three
"Left Outer Joins" in order to return every transaction for a specific
set of criteria.
Using three "Left Outer Joins"...
|
by: Web Science |
last post by:
Site and Features: http://www.eigensearch.com
Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
|
by: MariusI |
last post by:
Consider the following class layout
public class Order
{
public ProductOrder AddProductOrder(/* variables required to create a
product order */)
{
/* Check if the product order can be added...
|
by: Stephen Poley |
last post by:
I have the following situation:
- a table of employees, keyed on employee-id;
- a table of training sessions, keyed on session-id;
- a requirement to log who was present at which session, plus...
|
by: anurag_agrawal |
last post by:
Hi this i anurag, right now i am working on report genration project.
I have a result set which returns me some records depend upon the EmployeeId and startdate and enddate this i passed to a...
|
by: Henry J. |
last post by:
Is it true that the following query:
SELECT emp.empno, emp.lastname, dept.deptname
FROM emp LEFT OUTER JOIN dept
ON emp.workdept = dept.deptno
WHERE emp.salary 50000.00;
will run faster in...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |