Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Query Error

Status
Not open for further replies.

StarhawkGamer

Programmer
Jul 7, 2008
17
US
I'm attempting to build a parameter query in MS Query to pull data from an Access 2007 database into an Excel 2007 spreadsheet. I have attempted every permutation of the between statement that I can figure out and either I get a "Too Few Parameters. 2 Expected." error or I get all of the data without the criteria.
*Condition Field*
Code:
Field: TRAN_DTTM
Value: Between [Start Date] and [End Date]

*SQL CODE*
Code:
SELECT Adjustments.TRAN_DTTM, Adjustments.`Advocate ID`, Sum(Adjustments.TRAN_AMT) AS 'Sum of TRAN_AMT'
FROM `Y:\TP CL Database 2.0.accdb`.Adjustments Adjustments
GROUP BY Adjustments.TRAN_DTTM, Adjustments.`Advocate ID`
HAVING (Adjustments.TRAN_DTTM Between [Start Date] And [End Date])
 




Hi,

Only SIMPLE Where a=[some value]

So, unless 2007 is significantly different that previous versions of MS Query, must be done with some simple code.

Please post in Forum707 for a VBA code solution. I code "parameters" often in complex SQL, using MS Query.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top