Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with Syntax Error

Author  Topic 

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 13:28:28
I am getting the follwoing error with this block of code. What am I doing wrong?

Error Message:
Msg 102, Level 15, State 1, Line 15
Incorrect syntax near '<'.

Code:
SELECT
FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] & '_' & [ProductType2] & '_' & [ProductType3] AS Product,
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode,
Sum(IIf([ActualDate]<[MaturityDate],[NPVChgAmt],IIf([ActualDate]>=[MaturityDate],[NPVPriorAmt]*-1,0))) AS UnrealizedGainLossAmt,
Sum(IIf([ActualDate]>=[MaturityDate],([NPVCurrentAmt]),0)) AS RealizedGainLossAmt,
Sum(FACSOLAP.DBO.Positions.RevaluationCurrencyAmt) AS RevaluationCurrencyAmt,
Sum(FACSOLAP.DBO.Positions.NotionalCurrentAmt) AS SumOfNotionalCurrentAmt,
Sum(FACSOLAP.DBO.Positions.NotionalPriorAmt) AS SumOfNotionalPriorAmt,
Sum(FACSOLAP.DBO.Positions.NotionalChgAmt) AS SumOfNotionalChgAmt,
Sum(FACSOLAP.DBO.Positions.NPVCurrentAmt) AS SumOfNPVCurrentAmt,
Sum(FACSOLAP.DBO.Positions.NPVPriorAmt) AS SumOfNPVPriorAmt,
Sum(FACSOLAP.DBO.Positions.NPVChgAmt) AS SumOfNPVChgAmt INTO Tbl_FXDealsMakeTable

X002548
Not Just a Number

15586 Posts

Posted - 2010-08-03 : 13:32:35
well, this looks like access code...AND the statement is not complete

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 13:39:05
Yes it is Access that I am trying to convert to SQL Server. Not sure how to complete it then.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-08-03 : 13:47:06
Where is the FROM, WHERE and GROUP BY statements?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 13:53:27
Here is the entire statements. Sorry very new to SQL, actually worked with it for about 3 hours today only.

SELECT
FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] & '_' & [ProductType2] & '_' & [ProductType3] AS Product,
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode,

Sum(IIf([ActualDate]<[MaturityDate],[FACSOLAP.DBO.Positions.NPVChgAmt],IIf([ActualDate]>=[MaturityDate],[NPVPriorAmt]*-1,0))) AS UnrealizedGainLossAmt,
Sum(IIf([ActualDate]>=[MaturityDate],([NPVCurrentAmt]),0)) AS RealizedGainLossAmt,

Sum(FACSOLAP.DBO.Positions.RevaluationCurrencyAmt) AS RevaluationCurrencyAmt,
Sum(FACSOLAP.DBO.Positions.NotionalCurrentAmt) AS SumOfNotionalCurrentAmt,
Sum(FACSOLAP.DBO.Positions.NotionalPriorAmt) AS SumOfNotionalPriorAmt,
Sum(FACSOLAP.DBO.Positions.NotionalChgAmt) AS SumOfNotionalChgAmt,
Sum(FACSOLAP.DBO.Positions.NPVCurrentAmt) AS SumOfNPVCurrentAmt,
Sum(FACSOLAP.DBO.Positions.NPVPriorAmt) AS SumOfNPVPriorAmt,
Sum(FACSOLAP.DBO.Positions.NPVChgAmt) AS SumOfNPVChgAmt INTO Tbl_FXDealsMakeTable

FROM
FACSOLAP.DBO.Positions INNER JOIN
FACSOLAP.DBO.PositionType ON FACSOLAP.DBO.Positions.PositionTypeId = FACSOLAP.DBO.PositionType.PositionTypeId INNER JOIN
FACSOLAP.DBO.Product ON FACSOLAP.DBO.Positions.ProductId = FACSOLAP.DBO.Product.ProductId INNER JOIN FACSOLAP.DBO.Organization ON FACSOLAP.DBO.Positions.OrgId = FACSOLAP.DBO.Organization.OrgId INNER JOIN
FACSOLAP.DBO.Instrument ON FACSOLAP.DBO.Positions.InstrumentId = FACSOLAP.DBO.Instrument.InstrumentId INNER JOIN FACSOLAP.DBO.Trader ON FACSOLAP.DBO.Positions.TraderId = FACSOLAP.DBO.Trader.TraderId INNER JOIN
FACSOLAP.DBO.Customer ON FACSOLAP.DBO.Positions.CustomerId = FACSOLAP.DBO.Customer.CustomerId INNER JOIN FACSOLAP.DBO.Sales ON FACSOLAP.DBO.Positions.SalesId1 = FACSOLAP.DBO.Sales.SalesId INNER JOIN
FACSOLAP.DBO.Rate ON FACSOLAP.DBO.Positions.ExchangeRateId = FACSOLAP.DBO.Rate.RateId INNER JOIN FACSOLAP.DBO.Calendar ON FACSOLAP.DBO.Positions.CalendarId = FACSOLAP.DBO.Calendar.CalendarId

WHERE
FACSOLAP.DBO.PositionType.SourcePositionTypeId1<>'Position' AND FACSOLAP.DBO.Organization.OrgPoint5='96c2a'

GROUP BY
FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] & '_' & [ProductType2] & '_' & [ProductType3],
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode

HAVING FACSOLAP.DBO.Calendar.ActualDate=[EnterDate] AND FACSOLAP.DBO.PositionType.SourceSystemName Like 'OPICS*';
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-08-03 : 14:02:16
so you want this to be in sql server syntax.

Have the tables already been moved to sql server? what version?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 14:03:52
No, SQL 2005
Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 14:04:48
These are the two statement that are throwing the error message above

Sum(IIf([ActualDate]<[MaturityDate],[FACSOLAP.DBO.Positions.NPVChgAmt],IIf([ActualDate]>=[MaturityDate],[NPVPriorAmt]*-1,0))) AS UnrealizedGainLossAmt,

Sum(IIf([ActualDate]>=[MaturityDate],([NPVCurrentAmt]),0)) AS RealizedGainLossAmt,
Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 14:09:37
It is my understaning that there is not an IIf funtion in SQl, I need to convert to a SUM( Case When statement. Is this correct? and how I would I convert this
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-08-03 : 14:13:05
well if you haven't moved the tables, and we convert it, how are you going to test it?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 14:17:05
The tables have been moved, is what I am being told.
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-08-03 : 14:18:40
Your CASE expression will look something like this
SUM(CASE 
WHEN [ActualDate] < [MaturityDate] THEN
[FACSOLAP.DBO.Positions.NPVChgAmt]
ELSE [NPVPriorAmt] *- 1
END) AS
UnrealizedGainLossAmt,
SUM(CASE
WHEN [ActualDate] >= [MaturityDate]THEN [NPVCurrentAmt]
ELSE 0
END) AS
RealizedGainLossAmt,
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-08-03 : 14:19:53
[code]SELECT FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] & '_' & [ProductType2] & '_' & [ProductType3] AS Product,
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode,
SUM(CASE
WHEN [ActualDate] < [MaturityDate] THEN
[FACSOLAP.DBO.Positions.NPVChgAmt]
ELSE [NPVPriorAmt] *- 1
END) AS
UnrealizedGainLossAmt,
SUM(CASE
WHEN [ActualDate] >= [MaturityDate]THEN [NPVCurrentAmt]
ELSE 0
END) AS
RealizedGainLossAmt,
SUM(FACSOLAP.DBO.Positions.RevaluationCurrencyAmt) AS
RevaluationCurrencyAmt,
SUM(FACSOLAP.DBO.Positions.NotionalCurrentAmt) AS
SumOfNotionalCurrentAmt,
SUM(FACSOLAP.DBO.Positions.NotionalPriorAmt) AS
SumOfNotionalPriorAmt,
SUM(FACSOLAP.DBO.Positions.NotionalChgAmt) AS
SumOfNotionalChgAmt,
SUM(FACSOLAP.DBO.Positions.NPVCurrentAmt) AS
SumOfNPVCurrentAmt,
SUM(FACSOLAP.DBO.Positions.NPVPriorAmt) AS
SumOfNPVPriorAmt,
SUM(FACSOLAP.DBO.Positions.NPVChgAmt) AS
SumOfNPVChgAmt
INTO Tbl_FXDealsMakeTable
FROM FACSOLAP.DBO.Positions
INNER JOIN FACSOLAP.DBO.PositionType
ON FACSOLAP.DBO.Positions.PositionTypeId =
FACSOLAP.DBO.PositionType.PositionTypeId
INNER JOIN FACSOLAP.DBO.Product
ON FACSOLAP.DBO.Positions.ProductId = FACSOLAP.DBO.Product.ProductId
INNER JOIN FACSOLAP.DBO.Organization
ON FACSOLAP.DBO.Positions.OrgId = FACSOLAP.DBO.Organization.OrgId
INNER JOIN FACSOLAP.DBO.Instrument
ON FACSOLAP.DBO.Positions.InstrumentId =
FACSOLAP.DBO.Instrument.InstrumentId
INNER JOIN FACSOLAP.DBO.Trader
ON FACSOLAP.DBO.Positions.TraderId = FACSOLAP.DBO.Trader.TraderId
INNER JOIN FACSOLAP.DBO.Customer
ON FACSOLAP.DBO.Positions.CustomerId = FACSOLAP.DBO.Customer.CustomerId
INNER JOIN FACSOLAP.DBO.Sales
ON FACSOLAP.DBO.Positions.SalesId1 = FACSOLAP.DBO.Sales.SalesId
INNER JOIN FACSOLAP.DBO.Rate
ON FACSOLAP.DBO.Positions.ExchangeRateId = FACSOLAP.DBO.Rate.RateId
INNER JOIN FACSOLAP.DBO.Calendar
ON FACSOLAP.DBO.Positions.CalendarId = FACSOLAP.DBO.Calendar.CalendarId
WHERE FACSOLAP.DBO.PositionType.SourcePositionTypeId1 <> 'Position'
AND FACSOLAP.DBO.Organization.OrgPoint5 = '96c2a'
GROUP BY FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] & '_' & [ProductType2] & '_' & [ProductType3],
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode
HAVING FACSOLAP.DBO.Calendar.ActualDate = [EnterDate]
AND FACSOLAP.DBO.PositionType.SourceSystemName LIKE 'OPICS%'[/code]
Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 14:29:23
I replaced the Sum ( Case When Statements. Now I get this error


Msg 402, Level 16, State 1, Line 1
The data types varchar and varchar are incompatible in the boolean AND operator.


Code
SELECT
FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] & '_' & [ProductType2] & '_' & [ProductType3] AS Product,
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode,

SUM(CASE
WHEN [ActualDate] < [MaturityDate] THEN
[NPVChgAmt]
ELSE [NPVPriorAmt] *- 1
END) AS
UnrealizedGainLossAmt,

SUM(CASE
WHEN [ActualDate] >= [MaturityDate]THEN [NPVCurrentAmt]
ELSE 0
END) AS
RealizedGainLossAmt,

Sum(FACSOLAP.DBO.Positions.RevaluationCurrencyAmt) AS RevaluationCurrencyAmt,
Sum(FACSOLAP.DBO.Positions.NotionalCurrentAmt) AS SumOfNotionalCurrentAmt,
Sum(FACSOLAP.DBO.Positions.NotionalPriorAmt) AS SumOfNotionalPriorAmt,
Sum(FACSOLAP.DBO.Positions.NotionalChgAmt) AS SumOfNotionalChgAmt,
Sum(FACSOLAP.DBO.Positions.NPVCurrentAmt) AS SumOfNPVCurrentAmt,
Sum(FACSOLAP.DBO.Positions.NPVPriorAmt) AS SumOfNPVPriorAmt,
Sum(FACSOLAP.DBO.Positions.NPVChgAmt) AS SumOfNPVChgAmt

FROM
FACSOLAP.DBO.Positions INNER JOIN
FACSOLAP.DBO.PositionType ON FACSOLAP.DBO.Positions.PositionTypeId = FACSOLAP.DBO.PositionType.PositionTypeId INNER JOIN
FACSOLAP.DBO.Product ON FACSOLAP.DBO.Positions.ProductId = FACSOLAP.DBO.Product.ProductId INNER JOIN FACSOLAP.DBO.Organization ON FACSOLAP.DBO.Positions.OrgId = FACSOLAP.DBO.Organization.OrgId INNER JOIN
FACSOLAP.DBO.Instrument ON FACSOLAP.DBO.Positions.InstrumentId = FACSOLAP.DBO.Instrument.InstrumentId INNER JOIN FACSOLAP.DBO.Trader ON FACSOLAP.DBO.Positions.TraderId = FACSOLAP.DBO.Trader.TraderId INNER JOIN
FACSOLAP.DBO.Customer ON FACSOLAP.DBO.Positions.CustomerId = FACSOLAP.DBO.Customer.CustomerId INNER JOIN FACSOLAP.DBO.Sales ON FACSOLAP.DBO.Positions.SalesId1 = FACSOLAP.DBO.Sales.SalesId INNER JOIN
FACSOLAP.DBO.Rate ON FACSOLAP.DBO.Positions.ExchangeRateId = FACSOLAP.DBO.Rate.RateId INNER JOIN FACSOLAP.DBO.Calendar ON FACSOLAP.DBO.Positions.CalendarId = FACSOLAP.DBO.Calendar.CalendarId

WHERE
FACSOLAP.DBO.PositionType.SourcePositionTypeId1<>'Position' AND FACSOLAP.DBO.Organization.OrgPoint5='96c2a'

GROUP BY
FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] & '_' & [ProductType2] & '_' & [ProductType3],
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode

HAVING FACSOLAP.DBO.Calendar.ActualDate Between '07/01/2010' And '07/31/2010' AND FACSOLAP.DBO.PositionType.SourceSystemName Like 'OPICS*';
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-08-03 : 14:31:24
Change the "&" to "+". String Concatenation is done using "+".
Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 14:36:20
Thanks for the help, this is great so far but now it is throwing this message

Msg 102, Level 15, State 1, Line 46
Incorrect syntax near '='.

for this line

FACSOLAP.DBO.PositionType.SourcePositionTypeId1<>'Position' + FACSOLAP.DBO.Organization.OrgPoint5='96c2a'
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-08-03 : 14:39:38
There's no need to change
FACSOLAP.DBO.PositionType.SourcePositionTypeId1<>'Position' AND FACSOLAP.DBO.Organization.OrgPoint5='96c2a'
to
FACSOLAP.DBO.PositionType.SourcePositionTypeId1<>'Position' + FACSOLAP.DBO.Organization.OrgPoint5='96c2a'

You only need to change the symbol "&" to "+" wherever you have done string concatenation.

Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-08-03 : 14:40:53
[code]SELECT FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] + '_' & [ProductType2] + '_' & [ProductType3] AS Product,
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode,
SUM(CASE
WHEN [ActualDate] < [MaturityDate] THEN
[FACSOLAP.DBO.Positions.NPVChgAmt]
ELSE [NPVPriorAmt] *- 1
END) AS
UnrealizedGainLossAmt,
SUM(CASE
WHEN [ActualDate] >= [MaturityDate]THEN [NPVCurrentAmt]
ELSE 0
END) AS
RealizedGainLossAmt,
SUM(FACSOLAP.DBO.Positions.RevaluationCurrencyAmt) AS
RevaluationCurrencyAmt,
SUM(FACSOLAP.DBO.Positions.NotionalCurrentAmt) AS
SumOfNotionalCurrentAmt,
SUM(FACSOLAP.DBO.Positions.NotionalPriorAmt) AS
SumOfNotionalPriorAmt,
SUM(FACSOLAP.DBO.Positions.NotionalChgAmt) AS
SumOfNotionalChgAmt,
SUM(FACSOLAP.DBO.Positions.NPVCurrentAmt) AS
SumOfNPVCurrentAmt,
SUM(FACSOLAP.DBO.Positions.NPVPriorAmt) AS
SumOfNPVPriorAmt,
SUM(FACSOLAP.DBO.Positions.NPVChgAmt) AS
SumOfNPVChgAmt
INTO Tbl_FXDealsMakeTable
FROM FACSOLAP.DBO.Positions
INNER JOIN FACSOLAP.DBO.PositionType
ON FACSOLAP.DBO.Positions.PositionTypeId =
FACSOLAP.DBO.PositionType.PositionTypeId
INNER JOIN FACSOLAP.DBO.Product
ON FACSOLAP.DBO.Positions.ProductId = FACSOLAP.DBO.Product.ProductId
INNER JOIN FACSOLAP.DBO.Organization
ON FACSOLAP.DBO.Positions.OrgId = FACSOLAP.DBO.Organization.OrgId
INNER JOIN FACSOLAP.DBO.Instrument
ON FACSOLAP.DBO.Positions.InstrumentId =
FACSOLAP.DBO.Instrument.InstrumentId
INNER JOIN FACSOLAP.DBO.Trader
ON FACSOLAP.DBO.Positions.TraderId = FACSOLAP.DBO.Trader.TraderId
INNER JOIN FACSOLAP.DBO.Customer
ON FACSOLAP.DBO.Positions.CustomerId = FACSOLAP.DBO.Customer.CustomerId
INNER JOIN FACSOLAP.DBO.Sales
ON FACSOLAP.DBO.Positions.SalesId1 = FACSOLAP.DBO.Sales.SalesId
INNER JOIN FACSOLAP.DBO.Rate
ON FACSOLAP.DBO.Positions.ExchangeRateId = FACSOLAP.DBO.Rate.RateId
INNER JOIN FACSOLAP.DBO.Calendar
ON FACSOLAP.DBO.Positions.CalendarId = FACSOLAP.DBO.Calendar.CalendarId
WHERE FACSOLAP.DBO.PositionType.SourcePositionTypeId1 <> 'Position'
AND FACSOLAP.DBO.Organization.OrgPoint5 = '96c2a'
GROUP BY FACSOLAP.DBO.Calendar.ActualDate,
FACSOLAP.DBO.PositionType.SourceSystemName,
FACSOLAP.DBO.Organization.Company,
FACSOLAP.DBO.Organization.RC,
FACSOLAP.DBO.Organization.Inventory,
FACSOLAP.DBO.Organization.InventoryDescription,
FACSOLAP.DBO.Sales.SalesDescription2,
FACSOLAP.DBO.Organization.OrgPoint6,
[ProductType1] + '_' & [ProductType2] + '_' & [ProductType3],
FACSOLAP.DBO.Instrument.MaturityDate,
FACSOLAP.DBO.Instrument.DealNbr,
FACSOLAP.DBO.Instrument.DealSequenceNbr,
FACSOLAP.DBO.Rate.CCYCode
HAVING FACSOLAP.DBO.Calendar.ActualDate = [EnterDate]
AND FACSOLAP.DBO.PositionType.SourceSystemName LIKE 'OPICS%'[/code][code][/code]
Go to Top of Page

jswinney
Starting Member

10 Posts

Posted - 2010-08-03 : 14:42:37
Ok, I fixed that and it is actually not throwing errors and trying to query now. So hopefully it works. thanks for the help
Go to Top of Page
   

- Advertisement -