DarrenBoyer
IS-IT--Management
I'm trying to show how many total vehicles our customers have bought. I run into problems when I want to combine that information (field) with the regular query I've always used.
(This query helps record whether we've sent our recent customers a certain gift certificate.)
The query that returns our regular gift certificate canidates looks like this:
The query that counts the number of vehicles looks like this:
When trying to combine these two queries I get either a limit of the total vehicles bought to the dates in the 1st query or that the query can only return 1 record. If it would be easier to abbreviate the solution of write a generic one I should be able to get that working. Thanks,
(This query helps record whether we've sent our recent customers a certain gift certificate.)
The query that returns our regular gift certificate canidates looks like this:
Code:
SELECT [Manual-Vehicles].TransactionDate, Customers.IndivLastName, Customers.IndivFirstName, Customers.SpouseFirstName, Customers.Household, Customers.SpouseSurname, Customers.StreetAddress, Customers.Locale, Customers.Province, Customers.PostalCode, [Manual-Vehicles].GiftCert, [Manual-Vehicles].EmployeeID
FROM Customers INNER JOIN [Manual-Vehicles] ON Customers.CustomerID = [Manual-Vehicles].CustomerID
WHERE((([Manual-Vehicles].TransactionDate)>=[Forms]![frmGiftCertInput]![txtStartDate]) AND (([Manual-Vehicles].GiftCert)<>Yes) AND (([Manual-Vehicles].InventorySource)=[Forms]![frmGiftCertInput]![cmbDepartment]) AND (([Manual-Vehicles].SaleCategory)<>"Fleet"))
ORDER BY [Manual-Vehicles].TransactionDate, Customers.IndivLastName, [Manual-Vehicles].InventorySource, [Manual-Vehicles].TransactionDate;
The query that counts the number of vehicles looks like this:
Code:
SELECT Count([Manual-Vehicles].CustomerID) AS CountOfCustomerID
FROM Customers INNER JOIN [Manual-Vehicles] ON Customers.CustomerID = [Manual-Vehicles].CustomerID
GROUP BY Customers.IndivLastName;
When trying to combine these two queries I get either a limit of the total vehicles bought to the dates in the 1st query or that the query can only return 1 record. If it would be easier to abbreviate the solution of write a generic one I should be able to get that working. Thanks,