By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Storing & Using the Last Read Value

P: n/a
Hi,

I have a table consists which cosists of batch numbers, and assosiated
dates and times..ie the columns are batch, date and time. The data
within the table is not in any particular order.

With a report, I need to calculate and display the difference in date /
times between like batch numbers, ie displaying batch number, start
date & time, finish date & time and duration

Any suggestions on a possible approch would be appreciated

Thank you
Stephen

Aug 5 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Stephen" <st*****@ebacuk.demon.co.ukwrote in
news:11**********************@b28g2000cwb.googlegr oups.com:
Hi,

I have a table consists which cosists of batch numbers, and
assosiated dates and times..ie the columns are batch, date and
time. The data within the table is not in any particular
order.

With a report, I need to calculate and display the difference
in date / times between like batch numbers, ie displaying
batch number, start date & time, finish date & time and
duration

Any suggestions on a possible approch would be appreciated

Thank you
Stephen
When you say "between like batch numbers" do you mean similar
batch numbers or identical batch numbers?

As a general rule, one would use the sorting and grouping
features to group on the common portion of the batch numbers,
then sort on the individual batch numbers within the group, then
on start date./time. Calculating duration of the two fields in
the same row is done using the datediff() function to calculate
the difference between the two, Use the smallest unit of measure
(days, hours, minutes or seconds) that you wish to display, and
format the result to divide by the larger units to make it human
readable. Google in this newsgroup for a sec2dur() function that
does this formatting.

As to duration of the interval between adjacent start times,
from row to row, this is more difficult and requires some Visual
Basic code in the report, or a complex query that looks up the
previous start time. for the batch.


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 5 '06 #2

P: n/a

Bob Quintal wrote:
"Stephen" <st*****@ebacuk.demon.co.ukwrote in
news:11**********************@b28g2000cwb.googlegr oups.com:
Hi,

I have a table consists which cosists of batch numbers, and
assosiated dates and times..ie the columns are batch, date and
time. The data within the table is not in any particular
order.

With a report, I need to calculate and display the difference
in date / times between like batch numbers, ie displaying
batch number, start date & time, finish date & time and
duration

Any suggestions on a possible approch would be appreciated

Thank you
Stephen
When you say "between like batch numbers" do you mean similar
batch numbers or identical batch numbers?

As a general rule, one would use the sorting and grouping
features to group on the common portion of the batch numbers,
then sort on the individual batch numbers within the group, then
on start date./time. Calculating duration of the two fields in
the same row is done using the datediff() function to calculate
the difference between the two, Use the smallest unit of measure
(days, hours, minutes or seconds) that you wish to display, and
format the result to divide by the larger units to make it human
readable. Google in this newsgroup for a sec2dur() function that
does this formatting.

As to duration of the interval between adjacent start times,
from row to row, this is more difficult and requires some Visual
Basic code in the report, or a complex query that looks up the
previous start time. for the batch.


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com
Hi Bob

Thank you for the reply...

"between like batch numbers", this could be a mixure of identical, and
similar numbers...
In the similar case, if the start time was not available for the batch,
then end time of the previous batch would be used..

This probally makes it even more complex than I originally thought, and
therefore only acheived with VB code (any suggestions would be
appriciated)...

I had hoped it was just a case of reading the table once, to create an
orderd list, and then from this list, read the record before and after
inorder to determine the start and finish times..

Best Regards
Stephen

Aug 5 '06 #3

P: n/a
"Stephen" <st*****@ebacuk.demon.co.ukwrote in
news:11*********************@i3g2000cwc.googlegrou ps.com:
>
Bob Quintal wrote:
>"Stephen" <st*****@ebacuk.demon.co.ukwrote in
news:11**********************@b28g2000cwb.googleg roups.com:
Hi,

I have a table consists which cosists of batch numbers, and
assosiated dates and times..ie the columns are batch, date
and time. The data within the table is not in any
particular order.

With a report, I need to calculate and display the
difference in date / times between like batch numbers, ie
displaying batch number, start date & time, finish date &
time and duration

Any suggestions on a possible approch would be appreciated

Thank you
Stephen
When you say "between like batch numbers" do you mean similar
batch numbers or identical batch numbers?

As a general rule, one would use the sorting and grouping
features to group on the common portion of the batch numbers,
then sort on the individual batch numbers within the group,
then on start date./time. Calculating duration of the two
fields in the same row is done using the datediff() function
to calculate the difference between the two, Use the smallest
unit of measure (days, hours, minutes or seconds) that you
wish to display, and format the result to divide by the
larger units to make it human readable. Google in this
newsgroup for a sec2dur() function that does this formatting.

As to duration of the interval between adjacent start times,
from row to row, this is more difficult and requires some
Visual Basic code in the report, or a complex query that
looks up the previous start time. for the batch.


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Hi Bob

Thank you for the reply...

"between like batch numbers", this could be a mixure of
identical, and similar numbers...
In the similar case, if the start time was not available for
the batch, then end time of the previous batch would be used..

This probally makes it even more complex than I originally
thought, and therefore only acheived with VB code (any
suggestions would be appriciated)...

I had hoped it was just a case of reading the table once, to
create an orderd list, and then from this list, read the
record before and after inorder to determine the start and
finish times..

Best Regards
Stephen
May I suggest you fix the data, so that the times are properly
recorded.

If that's not possible, you could investigate using a recordset
in Visual Basic, to write the data to a temporary table. You can
use the .moveprevious and .movenext methods to get your data.

You could also use the report's .recordsetclone to move back and
forward and see the data for the current record.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 6 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.