Re: Query to select first record of changes between records

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



In a perfect world, you'd have a statuses table, so the different statuses
would have a different primary key and they'd be very clearly different.
You haven't really explained why 2B/E is different and why it would be
undesirable to get that record, too.

However, you might want to try something like

SELECT MIN(RecordID) FROM YourTable GROUP BY SiteID HAVING StatusCode LIKE
'*E*'

I'm not sure how you'd get the second attempt at nesting. Maybe you should
flag each "brood" with an ID. Then it would be very easy to determine the
day on which the eggs of the brood were first spotted.

HTH;

Amy

"peter kappes" <peterkappes@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B47DD28E-540C-4B41-938B-4C1B3F9F92FA@xxxxxxxxxxxxxxxx
Not sure how to explain my question, but perhaps some background on my
database will help. I'm putting together a database where employees use a
form to enter the status of various seabird nest sites that we are
monitoring
for a restoration project. Nests are monitored everyday, so each day a
code
is entered into the form indicating the status of the nest site on that
day
(e.g B/0=bird over nothing, B/E= bird over egg). During the course of the
year we will want to query this data to determine the first day that eggs
were seen at each nest. I'm trying to figure out a query that will, at
the
very least, select the very first record that contains an "*E*" in the
status
column. Unfortunately, I can't use *E* b/c that gives me the two codes
B/E
and 2B/E. I need something that can pick out just the first record that
contains E in the site status column. In a perfect world, it would be
better
to have a query that could select the first record that has an E in it
after
a string of records that do not contain an E. This way, I can determine
the
date that eggs were first seen in nests that have more than one breeding
attempt in a seaon (e.g. nest 1 is B/E on the first, loses this egg and
has
two weeks of B/0 and then another B/E). Thanks a bunch.


.



Relevant Pages

  • Re: Need advice on breeding/raising chicks
    ... We have two golf balls in our nest. ... If your hen wants to go broody she will - golf balls are not going to entice ... How long is it likely for one of the hens to get broody? ... Continue to collect your eggs daily and eat them as you go ...
    (sci.agriculture.poultry)
  • Re: Need advice on breeding/raising chicks
    ... We have two golf balls in our nest. ... Hens are individuals, and it is impossible to predict whether one will ... get broody at all, or whether she'll have such a strong instinct that it ... sit after they've laid a dozen eggs, others will lay for months and not ...
    (sci.agriculture.poultry)
  • Survivor
    ... We have had two Pilgrim geese hatch out nests this past week, ... As an aside, our old gander, Charlie, has taken a mate this year. ... nine youngsters and another goose on a nest of two eggs. ... The last gander has finally set his goose on a nest in the barn. ...
    (sci.agriculture.poultry)
  • Re: spawning fun
    ... I am hoping tomorrow or the next day he can come out of the spawning tank ... the eggs in the nest. ... the male does wrap his fins around the female during ...
    (rec.aquaria.freshwater.misc)
  • Re: fertility
    ... From the temperature of the eggs, ... Off her nest is 6 - 12 hours or more ... The older chicks do not react the same to Mum and can cause her to ...
    (sci.agriculture.poultry)