Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Parameter Query Date Serial

$
0
0
When I run the query I get an error saying that " . . . does not include the specified expression "St No" as part of the aggregate function."

St No is supposed to be a new field from the below Make Table Query.

Ninety percent of my parameter queries are by month and year but I have to enter >=01/01/2012 and <=01/31/2012. I just wish to enter a number for the month and a number for the year.

[Enter month] 1 [Enter Year] 2012

Code:

SELECT [TblCARETSData.StreetNumber] AS [St No]
, TblCARETSData.StreetName AS StName
, TblCARETSData.City
, TblCARETSData.ClosingDate AS Dte
, TblCARETSData.ListPrice AS AskPrice
, TblCARETSData.ClosePrice AS SalePrice
, TblCARETSData.ListAgentOfficeKey AS ListID
, TblCARETSData.ListOfficeName AS ListName
, TblCARETSData.SaleAgentOfficeKey AS SellID
, TblCARETSData.SaleOfficeName AS SellName
, TblCARETSData.ListAgentLastName AS AgentList
, TblCARETSData.SaleAgentLastName AS AgentSell INTO Scmls
FROM TblCARETSData
WHERE TblCARETSData.ClosingDate >=DATESERIAL([Enter Year],[Enter Month],1) And TblCARETSData.ClosingDate <DATEADD("m",1,DATESERIAL([Enter Year],[Enter Month],1))
GROUP BY YEAR(TblCARETSData.ClosingDate), MONTH(TblCARETSData.ClosingDate), county, city, closeprice;

I'm lost as to what is happening here.

Thanks . . . Rick

Viewing all articles
Browse latest Browse all 13329