Hi
I have two tables
tblBatchDetails which has the fields CreatedBy, CreatedDate, BatchNumber
tblSampleDetails which has the fields BatchNumber, MTNumber, CreatedDate, CreatedBy
The structure is that each batch has multiple samples and Batchnumber is the foreign key field in tblSampleDetails
I wish to write a query that shows the time taken between the last sample created in a batch and the time at which the next batch is created by the CreatedByField
So the logic would look something like this
Take the BatchNumber with the createdDate and minus the last sample created time.
I am ok using Dfirst to find the createddate for the current batch the user has created but I am unsure how to find the last sample the user created in the previous batch.
By the way the date fields are formatted to long date so I get the date and time.
If someone could point me in the direction of how to achieve this as I seem to want 2 lots of criteria ie 1) Batches the user has created and also 2) not from the current batch.
I hope this makes some sense
Thanks
Richard
I have two tables
tblBatchDetails which has the fields CreatedBy, CreatedDate, BatchNumber
tblSampleDetails which has the fields BatchNumber, MTNumber, CreatedDate, CreatedBy
The structure is that each batch has multiple samples and Batchnumber is the foreign key field in tblSampleDetails
I wish to write a query that shows the time taken between the last sample created in a batch and the time at which the next batch is created by the CreatedByField
So the logic would look something like this
Take the BatchNumber with the createdDate and minus the last sample created time.
I am ok using Dfirst to find the createddate for the current batch the user has created but I am unsure how to find the last sample the user created in the previous batch.
By the way the date fields are formatted to long date so I get the date and time.
If someone could point me in the direction of how to achieve this as I seem to want 2 lots of criteria ie 1) Batches the user has created and also 2) not from the current batch.
I hope this makes some sense
Thanks
Richard