Hi,
I am trying to query on a DateAdd column that I am creating in a query. It is returning data but the dates don't match with the criteria I am trying to pull out of the database. I am getting results on all 'product one' entries.
I am running this in a VBA statement to dynamically create the query but testing on the SQL looks like the information below:
SELECT Contact.ContactName, Product.ProductName, Product.StartDate, DateAdd("h",1,[Product].[StartDate]) as DateAddField
FROM Contact INNER JOIN Product
ON Contact.ContactID = Product.ContactID
WHERE (((DateAdd("h",1,[Product].[StartDate]))>=1/1/2016) AND (([Product].[Productname]) Like '*Product One*'));
Can anyone advise on what I am missing?
Thanks.
I am trying to query on a DateAdd column that I am creating in a query. It is returning data but the dates don't match with the criteria I am trying to pull out of the database. I am getting results on all 'product one' entries.
I am running this in a VBA statement to dynamically create the query but testing on the SQL looks like the information below:
SELECT Contact.ContactName, Product.ProductName, Product.StartDate, DateAdd("h",1,[Product].[StartDate]) as DateAddField
FROM Contact INNER JOIN Product
ON Contact.ContactID = Product.ContactID
WHERE (((DateAdd("h",1,[Product].[StartDate]))>=1/1/2016) AND (([Product].[Productname]) Like '*Product One*'));
Can anyone advise on what I am missing?
Thanks.