Re: Fill blanks with value from previous record
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Dec 2006 20:29:54 -0700
On Thu, 28 Dec 2006 09:34:01 -0800, xlcharlie
<xlcharlie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I'm sure this question is posted and answered elsewhere, but after some
searching I have yet to find anything. I have a dataset organized as below:
Ticket ID Order ID Execution ID Flag
ABC B
ABC 123
ABC 123 i.
ABC 123 ii.
XYZ S
XYZ 456
XYZ 456 i.
XYZ 456 ii.
I need to pull all the records where Execution ID Is Not Null, but I need to
include the Flag for the corresponding Ticket ID. Is there a way, with an
update query or simply querying an underlying query, that I can fill in the
blank values in field Flag with the nonblank values according to Ticket ID?
All records where Ticket ID Is Not Null will have a Flag value and all
records where Execution ID Is Not Null will NOT have a Flag value (Flag is
blank).
Hope that's clear enough. Thanks in advance.
This is quite possibly IMPOSSIBLE to do.
Tables HAVE NO ORDER. There is no "next record" that can be filled in
with data from the "previous record".
Unless it's appropriate to fill in ALL Null values of FLAG with the
non-null value from the same TicketID, I can't see any way to do this.
You *really* need to change your program logic - this is spreadsheet
thinking, not relational thinking, and it *will* get you in trouble!
If you have a one to many relationship between Tickets and Executions
(whatever those are... tickets to a public hanging...!?) then you
should model it as a one to many relationship between two tables.
John W. Vinson[MVP]
.
- Follow-Ups:
- Re: Fill blanks with value from previous record
- From: xlcharlie
- Re: Fill blanks with value from previous record
- Prev by Date: Re: Search Form Results
- Next by Date: Re: Square Peg in a Round Hole
- Previous by thread: I think this is simple...
- Next by thread: Re: Fill blanks with value from previous record
- Index(es):
Relevant Pages
|