Union Query Problems

G

Guest

I have created a union query named 'Combine' in order to combine like data from 2 different tables. I am able to run the query once, but am unable to run it again unless i close out of access and reopen the project.I keep getting an error message saying the microsoft jet database cannot find object'Combine' I have looked at the query many times and have no idea what i have done wrong. I don't know too much about access and need some help. i have included the query below.
Thanks
Bria

SELECT [Date], Int(Right$([dbo_CatsSwapHistTb]![TesId],Len([dbo_CatsSwapHistTb]![TesId])-1)) AS TicketId, [Type], Round(IIf( dbo_CatsSwapHistTb.CatsType not in(select [NPV Not Produced by CATS] from [NON CATS NPV]),IIf([Type]="BORROW",([Pay1NPV]/IIf(Int(Abs([Pay1FxRate]))<1,1,[Pay1FxRate])),[Pay2NPV]/[Pay2FxRate]-[Pay1NPV]/[Pay1FxRate]),0),2) AS [Net Exposure], [Pay1FxRate] AS [FX Rate],0 AS [Price] ,0 AS [AccrInt], [MaturityDt],1 as Facto
FROM dbo_CatsSwapHistT
WHERE (((dbo_CatsSwapHistTb.Date)=[Report Date]) AND ((dbo_CatsSwapHistTb.Type)<>"BORROW")

UNION Select [COB_Date], Int(IIf(Int(InStr(1,[TicketId]," "))=0,[TicketId],Left([TicketId],InStr(1,[TicketId]," ")))) AS [Deal Id],[Type],Round(IIf([Type]="FOREX",[LoanVal]-[CollVal],-(([LoanVal]+IIf(IsNull([LoanIntr]),0,[LoanIntr]))/[LoanFxRate]+([CollVal]+[CollIntr])/[CollFxRate])),2) AS [Net Exposure],[LoanFxRate] AS [FX Rate],[Price],[AccrInt],0,[factor
FROM dbo_ceDetailRecord
WHERE (((dbo_ceDetailRecords.COB_Date)=[Report Date]));
 
G

Gina

Try renaming the query qryCombine. Sounds like you
stumbled on a reserved word...
-----Original Message-----
I have created a union query named 'Combine' in order to
combine like data from 2 different tables. I am able to
run the query once, but am unable to run it again unless i
close out of access and reopen the project.I keep getting
an error message saying the microsoft jet database cannot
find object'Combine' I have looked at the query many times
and have no idea what i have done wrong. I don't know too
much about access and need some help. i have included the
query below.
Thanks,
Brian

SELECT [Date], Int(Right$([dbo_CatsSwapHistTb]![TesId],Len
([dbo_CatsSwapHistTb]![TesId])-1)) AS TicketId, [Type],
Round(IIf( dbo_CatsSwapHistTb.CatsType not in(select [NPV
Not Produced by CATS] from [NON CATS NPV]),IIf([Type]
="BORROW",([Pay1NPV]/IIf(Int(Abs([Pay1FxRate]))<1,1,
[Pay1FxRate])),[Pay2NPV]/[Pay2FxRate]-[Pay1NPV]/
[Pay1FxRate]),0),2) AS [Net Exposure], [Pay1FxRate] AS [FX
Rate],0 AS [Price] ,0 AS [AccrInt], [MaturityDt],1 as
Factor
FROM dbo_CatsSwapHistTb
WHERE (((dbo_CatsSwapHistTb.Date)=[Report Date]) AND
((dbo_CatsSwapHistTb.Type) said:
UNION Select [COB_Date], Int(IIf(Int(InStr(1,
[TicketId]," "))=0,[TicketId],Left([TicketId],InStr(1,
[TicketId]," ")))) AS [Deal Id],[Type],Round(IIf([Type]
="FOREX",[LoanVal]-[CollVal],-(([LoanVal]+IIf(IsNull
([LoanIntr]),0,[LoanIntr]))/[LoanFxRate]+([CollVal]+
[CollIntr])/[CollFxRate])),2) AS [Net Exposure],
[LoanFxRate] AS [FX Rate],[Price],[AccrInt],0,[factor]
FROM dbo_ceDetailRecords
WHERE (((dbo_ceDetailRecords.COB_Date)=[Report Date]));
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top