T
Tomas C
Howdy Folks,
I have a table that contains a series of asbestos sampling dates at
several different locations. A simplified version of the structure is as
shown below:
[Location]
[Sampler] - Company that performed the sampling
[Sample Date]
[Result] - Numerical Result
[Detection Flag] - Yes or No
When the detection flag is "Y" for a given day, I want to know if the
next day also has a detection. If not, I want to ignore that detection.
If yes, I want the first day to get flagged with a "1" and the
subsequent day to be flagged with a "2". This gets trickier when I have
more than two days in a row that have a detection. In fact I have no
idea how to approach such a case from a query perspective.
Ultimately, I want to look at date pairs. I want to know if a detection
on one day makes it more likely that a detection will occur the next
day. Let's consider the data below. We'll assume that all are detections:
Date
1/1/2008
1/2/2008
1/3/2008
1/4/2008
1/10/2008
1/15/2008
1/16/2008
1/25/2008
I think what I would like to see as my end product is this:
Date Detection Day
1/1/2008 1
1/2/2008 2
1/2/2008 1
1/3/2008 2
1/3/2008 1
1/4/2008 2
1/15/2008 1
1/16/2008 2
Note that a date can appear twice if it occurs in a block of detections
where n > 2. Does anyone have any advice on how to proceed? I would
greatly appreciate it.
Thanks in advance.
I have a table that contains a series of asbestos sampling dates at
several different locations. A simplified version of the structure is as
shown below:
[Location]
[Sampler] - Company that performed the sampling
[Sample Date]
[Result] - Numerical Result
[Detection Flag] - Yes or No
When the detection flag is "Y" for a given day, I want to know if the
next day also has a detection. If not, I want to ignore that detection.
If yes, I want the first day to get flagged with a "1" and the
subsequent day to be flagged with a "2". This gets trickier when I have
more than two days in a row that have a detection. In fact I have no
idea how to approach such a case from a query perspective.
Ultimately, I want to look at date pairs. I want to know if a detection
on one day makes it more likely that a detection will occur the next
day. Let's consider the data below. We'll assume that all are detections:
Date
1/1/2008
1/2/2008
1/3/2008
1/4/2008
1/10/2008
1/15/2008
1/16/2008
1/25/2008
I think what I would like to see as my end product is this:
Date Detection Day
1/1/2008 1
1/2/2008 2
1/2/2008 1
1/3/2008 2
1/3/2008 1
1/4/2008 2
1/15/2008 1
1/16/2008 2
Note that a date can appear twice if it occurs in a block of detections
where n > 2. Does anyone have any advice on how to proceed? I would
greatly appreciate it.
Thanks in advance.