Hello all,
Been working on this for a while now and can't get it to work how I'd like after trying a few things.
I have a form ("Production Form") from where users input start and end times for various processes against a particular product. Currently, I have (or had) a query (and linked report) "ProductionDurations" where durations for each of the processes were calculated for different product runs.
I have since tried to adapt this query to include reference values contained in another query ("ProductionDurationsPerBulkLitre", based on a "Products" table) for how long each process should take for each production, by multiplying by the volume processed. Here's what I have at the moment in the "ProductionDurations" query:
Rather than returning what I require, the above bolded part is returning a calculated value for each production against each of the products. What I require is a calculated value for each production against the product that has been selected on the form.
I'm aware I may not be making this as clear as possible, and that the syntax of my SQL may be poorly-constructed, so feel free to ask me further questions.
Any help will be gratefully appreciated at this stage!
Been working on this for a while now and can't get it to work how I'd like after trying a few things.
I have a form ("Production Form") from where users input start and end times for various processes against a particular product. Currently, I have (or had) a query (and linked report) "ProductionDurations" where durations for each of the processes were calculated for different product runs.
I have since tried to adapt this query to include reference values contained in another query ("ProductionDurationsPerBulkLitre", based on a "Products" table) for how long each process should take for each production, by multiplying by the volume processed. Here's what I have at the moment in the "ProductionDurations" query:
SELECT DateDiff("n",[BlendlineCIPStartTime],[BlendlineCIPEndTime]) AS BlendlineCIPDuration, DateDiff("n",[FlavourMixStartTime],[FlavourMixEndTime]) AS FlavourMixDuration, DateDiff("n",[BlendlineStartTime],[BlendlineEndTime]) AS BlendlineDuration, DateDiff("n",[TankCIPStartTime],[TankCIPEndTime]) AS TankCIPDuration, [Production Form].[ProductionRef#], [Production Form].ProductionDate, [Production Form].Product, [BlendlineCIPDuration]+[FlavourMixDuration]+[BlendlineDuration]+[TankCIPDuration] AS TotalDuration, ProdWeek([Production Form].[ProductionDate]) AS ProductionWeek, [Production Form].BulkVolumeLitres, [Production Form].[BulkVolumeLitres]*[ProductDurationsPerBulkLitre].[BlendlineCIPTimeMinsPerBulkLitres] AS ExpectedBlendlineCIPDuration
FROM [Production Form], ProductDurationsPerBulkLitre
ORDER BY [Production Form].[ProductionRef#];
Rather than returning what I require, the above bolded part is returning a calculated value for each production against each of the products. What I require is a calculated value for each production against the product that has been selected on the form.
I'm aware I may not be making this as clear as possible, and that the syntax of my SQL may be poorly-constructed, so feel free to ask me further questions.
Any help will be gratefully appreciated at this stage!