F
F
favbet2015-07-11 11:41:56
Microsoft Access
favbet, 2015-07-11 11:41:56

What is wrong with join request?

SELECT "LE 2015" as Year, Month, Responsible, Price
from Budget
where Year="2015" UNION
ALL
SELECT "LE 2015" as Year, Month, Responsible, Price
from Budget
where Year="2015"
query where Year="2015"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
saltydogd, 2015-07-11
@saltydogd

Try option

SELECT [LE 2015] as Year, Month, Responsible, Price 
from Budget
where [LE 2015] ="2015"
UNION ALL 
SELECT [LE 2015]  as Year, Month, Responsible, Price 
from Budget 
where [LE 2015] ="2015"

// if, of course, the year is stored as a string
// and, as said, naming identifiers that coincide with service names should be avoided

F
favbet, 2015-07-11
@favbet

INSERT INTO Budget ( [Year], [Month], Responsible, Price )
SELECT "LE 2015" as Year, Month, Responsible, Price
from Budget
where Year="2015"
UNION ALL
SELECT "LE 2015" as Year, Month, Responsible , Price
from Budget
where Year="2015"
Sorry, the inner part of the query without an insert works fine, when I add an insert, it gives an error.
Who can tell why?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question