I HAVE a "Select-UNION". SELECT THE FIRST PART 10 RECORDS AND SELECTION PART 2 WORKS PERFECTLY IN TRAINING REGISTROS.ESTA SQLSERVER, BUT DOES NOT WORK WITH SALTBLPOPULATE. WHY DO NOT REGARD THE STATUS OF THE SECOND PART AND SELECT ALL.
I THINK THE PROBLEM IS WITH THE FIELDS OF SQLSERVER DATETIME WITH TEAM DEVELOPER
Select cempre,’1’ as orden,
count(distinct(nrutac))
from acaerdac
WHERE fcancela >= ‘xxxx-xx-xx’ and
fcancela < ‘xxxx-xx-xx’ and
(cedivi = 3
or cedivi = 6)
Group by cempre
union all
Select cempre,’2’ as orden,
count(distinct(nrutac))
from acaerdac
WHERE fcancela >= ‘xxxx-xx-xx’ and
fcancela < ‘xxxx-xx-xx’ and
cedivi = 4
Group by cempre
ORDER BY 2
QUESTION OF INSTRUCTION SQL (SELECT UNION)
Re: QUESTION OF INSTRUCTION SQL (SELECT UNION)
Have you installed the Sql Server service pack?
Re: QUESTION OF INSTRUCTION SQL (SELECT UNION)
Select cempre,’1’ as orden,count(distinct(nrutac))
from acaerdac
INTO :Column1,:Column2,:Column3
WHERE fcancela >= ‘xxxx-xx-xx’ and
fcancela < ‘xxxx-xx-xx’ and (cedivi = 3 or cedivi = 6)
Group by cempre
union all
Select cempre,’2’ as orden,count(distinct(nrutac))
from acaerdac
WHERE fcancela >= ‘xxxx-xx-xx’ and fcancela < ‘xxxx-xx-xx’ and cedivi = 4
Group by cempre
ORDER BY 2
Better use Into-Vars?
Best regards,
Thomas
from acaerdac
INTO :Column1,:Column2,:Column3
WHERE fcancela >= ‘xxxx-xx-xx’ and
fcancela < ‘xxxx-xx-xx’ and (cedivi = 3 or cedivi = 6)
Group by cempre
union all
Select cempre,’2’ as orden,count(distinct(nrutac))
from acaerdac
WHERE fcancela >= ‘xxxx-xx-xx’ and fcancela < ‘xxxx-xx-xx’ and cedivi = 4
Group by cempre
ORDER BY 2
Better use Into-Vars?
Best regards,
Thomas
Who is online
Users browsing this forum: [Ccbot] and 1 guest