ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   "Too Few Parameters" Message (https://www.excelbanter.com/excel-discussion-misc-queries/142340-too-few-parameters-message.html)

DT

"Too Few Parameters" Message
 
While trying to return data in Excel from an Access database source, I
receive the message "Too Few Parameters - Expected 1". There are several
different queries as source data leading up to the final output and I've
narrowed it down to an issue with a Union query (below). Any suggestions as
to what might be the problem? Thanks.

SELECT [Proj No],[Top Task], [Task No],[Task Name],[Budget Resource],[Tot
Direct Cost Budget],[Exp Type], [Direct Cost PJTD], [Thru Date]
FROM [q155187-I3-BudgetvsCost]

UNION ALL SELECT [Proj No],[Top Task],[Task No],[Task Name],"" as [Budget
Resource],0 as [Tot Direct Cost Budget],[Exp Type], [Direct Cost PJTD], [Thru
Date]
FROM [q155187-I3-NoBudgetResource];


Nick Hodge

"Too Few Parameters" Message
 
DT

MSQuery will not work with union queries

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk
blog (non-tech): www.nickhodge.co.uk/blog/
"DT" wrote in message
...
While trying to return data in Excel from an Access database source, I
receive the message "Too Few Parameters - Expected 1". There are several
different queries as source data leading up to the final output and I've
narrowed it down to an issue with a Union query (below). Any suggestions
as
to what might be the problem? Thanks.

SELECT [Proj No],[Top Task], [Task No],[Task Name],[Budget Resource],[Tot
Direct Cost Budget],[Exp Type], [Direct Cost PJTD], [Thru Date]
FROM [q155187-I3-BudgetvsCost]

UNION ALL SELECT [Proj No],[Top Task],[Task No],[Task Name],"" as [Budget
Resource],0 as [Tot Direct Cost Budget],[Exp Type], [Direct Cost PJTD],
[Thru
Date]
FROM [q155187-I3-NoBudgetResource];



DT

"Too Few Parameters" Message
 
Thanks for your response. While the Union query was the issue, I did get the
data to return in Excel by changing the sql statement "" as [Budget
Resource] to '' as [Budget Resource] (from double-quote to
double-apostrophe) when a co-worker suggested that Excel doesn't recognize
double-quote. That took care of the error issue

Thanks again.

"Nick Hodge" wrote:

DT

MSQuery will not work with union queries

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk
blog (non-tech): www.nickhodge.co.uk/blog/
"DT" wrote in message
...
While trying to return data in Excel from an Access database source, I
receive the message "Too Few Parameters - Expected 1". There are several
different queries as source data leading up to the final output and I've
narrowed it down to an issue with a Union query (below). Any suggestions
as
to what might be the problem? Thanks.

SELECT [Proj No],[Top Task], [Task No],[Task Name],[Budget Resource],[Tot
Direct Cost Budget],[Exp Type], [Direct Cost PJTD], [Thru Date]
FROM [q155187-I3-BudgetvsCost]

UNION ALL SELECT [Proj No],[Top Task],[Task No],[Task Name],"" as [Budget
Resource],0 as [Tot Direct Cost Budget],[Exp Type], [Direct Cost PJTD],
[Thru
Date]
FROM [q155187-I3-NoBudgetResource];




All times are GMT +1. The time now is 06:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com