Hit a problem today which I can't seem to work out or find an answer anywhere.
In a nutshell, a customer of mine has a program that can use either an Access or SQL database.
For the past 2 years, they've used Access, and today have switched over to SQL.
All has gone good, until they've received the following error message:
The minimum aggregate operation cannot take a bit data type as an argument.
I've look at both databases and the error is connected with a field called "IPPTAG". In Access, the datatype of this field is "Yes/No" in SQL it's a BIT.
Now I know they are technically the same thing, but the following SQL command is throwing a wobbler when run.
In Access, it runs perfect, in SQL it crashes with the error, removing the MIN(d.IPPTag) reference causes it to work.
Any ideas if there's a way to get it working?
Query is:
SELECT d.BasicPartNo, d.LatestPartNo, d.PartColour, MAX(d.Description) AS FirstDesc, MIN(d.IPPTag) AS MinIppTag, SUM(W1QtyRequired) AS Required FROM DeliverySchedule d WHERE d.SupplierID = 1 AND d.WarehouseID = 1 AND d.OrderType = 1 AND d.PlanCode = 'U4AF01' AND d.ShipToCode = 'SDC1' AND d.ProdPeriod = 42 AND d.DateTimeDelivery = {ts'2006-10-16 11:00:00'} AND d.Creator = 1 AND d.W1QtyRequired IS NOT NULL GROUP BY d.BasicPartNo, d.LatestPartNo, d.PartColour ORDER BY d.BasicPartNo, d.LatestPartNo, d.PartColour
In a nutshell, a customer of mine has a program that can use either an Access or SQL database.
For the past 2 years, they've used Access, and today have switched over to SQL.
All has gone good, until they've received the following error message:
The minimum aggregate operation cannot take a bit data type as an argument.
I've look at both databases and the error is connected with a field called "IPPTAG". In Access, the datatype of this field is "Yes/No" in SQL it's a BIT.
Now I know they are technically the same thing, but the following SQL command is throwing a wobbler when run.
In Access, it runs perfect, in SQL it crashes with the error, removing the MIN(d.IPPTag) reference causes it to work.
Any ideas if there's a way to get it working?
Query is:
SELECT d.BasicPartNo, d.LatestPartNo, d.PartColour, MAX(d.Description) AS FirstDesc, MIN(d.IPPTag) AS MinIppTag, SUM(W1QtyRequired) AS Required FROM DeliverySchedule d WHERE d.SupplierID = 1 AND d.WarehouseID = 1 AND d.OrderType = 1 AND d.PlanCode = 'U4AF01' AND d.ShipToCode = 'SDC1' AND d.ProdPeriod = 42 AND d.DateTimeDelivery = {ts'2006-10-16 11:00:00'} AND d.Creator = 1 AND d.W1QtyRequired IS NOT NULL GROUP BY d.BasicPartNo, d.LatestPartNo, d.PartColour ORDER BY d.BasicPartNo, d.LatestPartNo, d.PartColour