Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Extracting range of data in a table

Discussion in 'Information Technology' started by CSS, Jul 28, 2006.

  1. CSS

    CSS
    Expand Collapse
    Guest

    One more issue I need resolved with my database.

    I import a text file into a table; however, I need to extract only a portion
    of the data.
    I cannot run a query because the imported text file is actually a report
    that is split into three sections. I need the second section so I'm
    searching for particular text.
    The sections are confirmed fraud, unconfirmed and no fraud. I need to write
    some logic to find the unconfirmed text and select the rows through to the no
    fraud section. There is only one occurrence of the text for each section.

    Any suggestion?
     
  2. Loading...

    Similar Threads Forum Date
    Range Rovers Blogs Oct 16, 2015
    SciTech Strange Blue World: Alien Planet's True Color Revealed, a First Breaking News Jul 12, 2013
    My Purchase of the 1994 Blue Range Rover LSE Business, Lifestyle & Leisure Nov 27, 2012
    Orange New to Sikhism Aug 9, 2012
    Truth Stranger Than Fiction! Interfaith Dialogues May 26, 2012

  3. Pat Hartman\(MVP\)

    Pat Hartman\(MVP\)
    Expand Collapse
    Guest

    Why do you say that you cannot run a query? A query is the ONLY method
    available for selecting data from a table. To select the "second section"
    you need to include criteria in your query that identifies the rows you are
    looking for.

    "CSS" <CSS@discussions.microsoft.com> wrote in message
    news:7FD7B1FE-6B2A-4816-9E58-AA493902B86A@microsoft.com...
    > One more issue I need resolved with my database.
    >
    > I import a text file into a table; however, I need to extract only a
    > portion
    > of the data.
    > I cannot run a query because the imported text file is actually a report
    > that is split into three sections. I need the second section so I'm
    > searching for particular text.
    > The sections are confirmed fraud, unconfirmed and no fraud. I need to
    > write
    > some logic to find the unconfirmed text and select the rows through to the
    > no
    > fraud section. There is only one occurrence of the text for each section.
    >
    > Any suggestion?
     
  4. CSS

    CSS
    Expand Collapse
    Guest

    How would I write the query? There is no other information that I can use to
    exclude the confirmed fraud and no fraud sections. The words "confirmed
    fraud" and "no fraud" only appear once in the table because I imported the
    report (they are sections of a report). I have visual basic logic in Excel
    that sets the range to extract the Unconfirmed and paste it into a new
    spreadsheet. However, I want to perform the same or a similar function
    within Access so I don't need to use both Excel and Access.

    "Pat Hartman(MVP)" wrote:

    > Why do you say that you cannot run a query? A query is the ONLY method
    > available for selecting data from a table. To select the "second section"
    > you need to include criteria in your query that identifies the rows you are
    > looking for.
    >
    > "CSS" <CSS@discussions.microsoft.com> wrote in message
    > news:7FD7B1FE-6B2A-4816-9E58-AA493902B86A@microsoft.com...
    > > One more issue I need resolved with my database.
    > >
    > > I import a text file into a table; however, I need to extract only a
    > > portion
    > > of the data.
    > > I cannot run a query because the imported text file is actually a report
    > > that is split into three sections. I need the second section so I'm
    > > searching for particular text.
    > > The sections are confirmed fraud, unconfirmed and no fraud. I need to
    > > write
    > > some logic to find the unconfirmed text and select the rows through to the
    > > no
    > > fraud section. There is only one occurrence of the text for each section.
    > >
    > > Any suggestion?

    >
    >
    >
     
  5. Jen

    Jen
    Expand Collapse
    Guest

    How about using VBA code to make a pass over the data after importing it,
    delete everything before the middle section, keep everything after that until
    you get to the last section, then delete everything after that.

    alternatively, if a key is being assigned as the data is imported, use a
    query to look up the records with the section headers in it, then delete
    everything less than the 2nd section header and greater than the third
    section header key.

    Enjoy, j.

    "CSS" wrote:

    > One more issue I need resolved with my database.
    >
    > I import a text file into a table; however, I need to extract only a portion
    > of the data.
    > I cannot run a query because the imported text file is actually a report
    > that is split into three sections. I need the second section so I'm
    > searching for particular text.
    > The sections are confirmed fraud, unconfirmed and no fraud. I need to write
    > some logic to find the unconfirmed text and select the rows through to the no
    > fraud section. There is only one occurrence of the text for each section.
    >
    > Any suggestion?
     
  6. Pat Hartman\(MVP\)

    Pat Hartman\(MVP\)
    Expand Collapse
    Guest

    Relational databases are not spreadsheets. They work very differently.
    There is no concept of row number or range. Those are "flat" file concepts.
    With a relational database you use queries with selection criteria to select
    sets of data. That means that your table must include a column with data
    that will allow you to select what you want.

    Jen suggested a VBA process. Another possibility is to write a macro in
    Excel that assigns each row to a group BEFORE you import the data. That
    will allow you to run queries once the data is loaded.

    "CSS" <CSS@discussions.microsoft.com> wrote in message
    news:0F9D6BF3-2FDC-4D12-9150-F7CCEF9E4E26@microsoft.com...
    > How would I write the query? There is no other information that I can use
    > to
    > exclude the confirmed fraud and no fraud sections. The words "confirmed
    > fraud" and "no fraud" only appear once in the table because I imported the
    > report (they are sections of a report). I have visual basic logic in
    > Excel
    > that sets the range to extract the Unconfirmed and paste it into a new
    > spreadsheet. However, I want to perform the same or a similar function
    > within Access so I don't need to use both Excel and Access.
    >
    > "Pat Hartman(MVP)" wrote:
    >
    >> Why do you say that you cannot run a query? A query is the ONLY method
    >> available for selecting data from a table. To select the "second
    >> section"
    >> you need to include criteria in your query that identifies the rows you
    >> are
    >> looking for.
    >>
    >> "CSS" <CSS@discussions.microsoft.com> wrote in message
    >> news:7FD7B1FE-6B2A-4816-9E58-AA493902B86A@microsoft.com...
    >> > One more issue I need resolved with my database.
    >> >
    >> > I import a text file into a table; however, I need to extract only a
    >> > portion
    >> > of the data.
    >> > I cannot run a query because the imported text file is actually a
    >> > report
    >> > that is split into three sections. I need the second section so I'm
    >> > searching for particular text.
    >> > The sections are confirmed fraud, unconfirmed and no fraud. I need to
    >> > write
    >> > some logic to find the unconfirmed text and select the rows through to
    >> > the
    >> > no
    >> > fraud section. There is only one occurrence of the text for each
    >> > section.
    >> >
    >> > Any suggestion?

    >>
    >>
    >>
     

Share This Page