Help Display every 5th line

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I pull every 5th line out of my database table and place into a new
table?
 
Your table should really be sorted on a field first, otherwise, there is no
guarantee of the order that the records will be retrieved from the table.
What is your primary key if one is defined? and is there any way you can
apply a formula to this field to accomplish your goal?
 
Yes I have sorded the records on field 8. I do not have a primary key. How
would I apply a formula to field 1?
 
Tom,

Could you give an example of the data that you have, showing the way it is
sorted, and the way you want these rows extracted.

Thanks,

Chris.
 
I have 10 fields in all field. They are in order lastname, firstname, case
Number, dos,units, facility, provider, rem source, ref number,. when we go
out to do an audit of records we pull every 5th record.
 
OK,

The simplest way to do this is to add a new field to your table called
somthing like RecordNumber.
Make it of type AutoNumber, then every time you add a new record, it will
automatically be allocated a sequential number.

Then it will be quite easy to do what you want:

SELECT * FROM MyTable
WHERE
[RecordNumber]/5-Int([RecordNumber]/5)=0;
-- Might well be a better way than this, but can't think just now. Too late
on a Friday afternoon... :-)
 
Another way is following ChrisM's advice like this --
SELECT * FROM MyTable
WHERE
[RecordNumber] Mod 5=0;


ChrisM said:
OK,

The simplest way to do this is to add a new field to your table called
somthing like RecordNumber.
Make it of type AutoNumber, then every time you add a new record, it will
automatically be allocated a sequential number.

Then it will be quite easy to do what you want:

SELECT * FROM MyTable
WHERE
[RecordNumber]/5-Int([RecordNumber]/5)=0;
-- Might well be a better way than this, but can't think just now. Too late
on a Friday afternoon... :-)
 
That works great.. Now I need to add one more thing into the mix, in the
field were the provider is, if they have provided less than 25 services i
need it to show all of them.
--
Tom


KARL DEWEY said:
Another way is following ChrisM's advice like this --
SELECT * FROM MyTable
WHERE
[RecordNumber] Mod 5=0;


ChrisM said:
OK,

The simplest way to do this is to add a new field to your table called
somthing like RecordNumber.
Make it of type AutoNumber, then every time you add a new record, it will
automatically be allocated a sequential number.

Then it will be quite easy to do what you want:

SELECT * FROM MyTable
WHERE
[RecordNumber]/5-Int([RecordNumber]/5)=0;
-- Might well be a better way than this, but can't think just now. Too late
on a Friday afternoon... :-)

Tom said:
I have 10 fields in all field. They are in order lastname, firstname, case
Number, dos,units, facility, provider, rem source, ref number,. when we go
out to do an audit of records we pull every 5th record.
--
Tom


:

Tom,

Could you give an example of the data that you have, showing the way it
is
sorted, and the way you want these rows extracted.

Thanks,

Chris.

Yes I have sorded the records on field 8. I do not have a primary key.
How
would I apply a formula to field 1?
--
Tom


:

Your table should really be sorted on a field first, otherwise, there
is
no
guarantee of the order that the records will be retrieved from the
table.
What is your primary key if one is defined? and is there any way you
can
apply a formula to this field to accomplish your goal?

How can I pull every 5th line out of my database table and place
into a
new
table?
 
if they have provided less than 25 services
Who is they? Who are you auditing? lastname, dos, units, facility,
provider, rem source?
You will need another query to pull that information.
What do you need to show all - all records or all [fill in the blank] that
have provided less than 25 services?


Tom said:
That works great.. Now I need to add one more thing into the mix, in the
field were the provider is, if they have provided less than 25 services i
need it to show all of them.
--
Tom


KARL DEWEY said:
Another way is following ChrisM's advice like this --
SELECT * FROM MyTable
WHERE
[RecordNumber] Mod 5=0;


ChrisM said:
OK,

The simplest way to do this is to add a new field to your table called
somthing like RecordNumber.
Make it of type AutoNumber, then every time you add a new record, it will
automatically be allocated a sequential number.

Then it will be quite easy to do what you want:

SELECT * FROM MyTable
WHERE
[RecordNumber]/5-Int([RecordNumber]/5)=0;
-- Might well be a better way than this, but can't think just now. Too late
on a Friday afternoon... :-)

I have 10 fields in all field. They are in order lastname, firstname, case
Number, dos,units, facility, provider, rem source, ref number,. when we go
out to do an audit of records we pull every 5th record.
--
Tom


:

Tom,

Could you give an example of the data that you have, showing the way it
is
sorted, and the way you want these rows extracted.

Thanks,

Chris.

Yes I have sorded the records on field 8. I do not have a primary key.
How
would I apply a formula to field 1?
--
Tom


:

Your table should really be sorted on a field first, otherwise, there
is
no
guarantee of the order that the records will be retrieved from the
table.
What is your primary key if one is defined? and is there any way you
can
apply a formula to this field to accomplish your goal?

How can I pull every 5th line out of my database table and place
into a
new
table?
 
We have people that provide service to clients, we audit there medical record
to make sure every thing is there and in the right order. if a provider had
less than 25 services that he or she provided we audit all of there records.
Need to show all that have provided less than 25 services.
--
Tom


KARL DEWEY said:
Who is they? Who are you auditing? lastname, dos, units, facility,
provider, rem source?
You will need another query to pull that information.
What do you need to show all - all records or all [fill in the blank] that
have provided less than 25 services?


Tom said:
That works great.. Now I need to add one more thing into the mix, in the
field were the provider is, if they have provided less than 25 services i
need it to show all of them.
--
Tom


KARL DEWEY said:
Another way is following ChrisM's advice like this --
SELECT * FROM MyTable
WHERE
[RecordNumber] Mod 5=0;


:

OK,

The simplest way to do this is to add a new field to your table called
somthing like RecordNumber.
Make it of type AutoNumber, then every time you add a new record, it will
automatically be allocated a sequential number.

Then it will be quite easy to do what you want:

SELECT * FROM MyTable
WHERE
[RecordNumber]/5-Int([RecordNumber]/5)=0;
-- Might well be a better way than this, but can't think just now. Too late
on a Friday afternoon... :-)

I have 10 fields in all field. They are in order lastname, firstname, case
Number, dos,units, facility, provider, rem source, ref number,. when we go
out to do an audit of records we pull every 5th record.
--
Tom


:

Tom,

Could you give an example of the data that you have, showing the way it
is
sorted, and the way you want these rows extracted.

Thanks,

Chris.

Yes I have sorded the records on field 8. I do not have a primary key.
How
would I apply a formula to field 1?
--
Tom


:

Your table should really be sorted on a field first, otherwise, there
is
no
guarantee of the order that the records will be retrieved from the
table.
What is your primary key if one is defined? and is there any way you
can
apply a formula to this field to accomplish your goal?

How can I pull every 5th line out of my database table and place
into a
new
table?
 
Create a totals query to pull provider with less or equal count of 25. Name
it LowProvider.
SELECT [MyTable].provider, Count([MyTable].provider) AS CountOfprovider
FROM [MyTable]
GROUP BY [MyTable].provider
HAVING (((Count([MyTable]))<=25));

SELECT * FROM [MyTable], LowProvider
WHERE
[RecordNumber] Mod 5=0 Or [MyTable].provider = LowProvider.provider;


Tom said:
We have people that provide service to clients, we audit there medical record
to make sure every thing is there and in the right order. if a provider had
less than 25 services that he or she provided we audit all of there records.
Need to show all that have provided less than 25 services.
--
Tom


KARL DEWEY said:
if they have provided less than 25 services
Who is they? Who are you auditing? lastname, dos, units, facility,
provider, rem source?
You will need another query to pull that information.
need it to show all of them.
What do you need to show all - all records or all [fill in the blank] that
have provided less than 25 services?


Tom said:
That works great.. Now I need to add one more thing into the mix, in the
field were the provider is, if they have provided less than 25 services i
need it to show all of them.
--
Tom


:

Another way is following ChrisM's advice like this --
SELECT * FROM MyTable
WHERE
[RecordNumber] Mod 5=0;


:

OK,

The simplest way to do this is to add a new field to your table called
somthing like RecordNumber.
Make it of type AutoNumber, then every time you add a new record, it will
automatically be allocated a sequential number.

Then it will be quite easy to do what you want:

SELECT * FROM MyTable
WHERE
[RecordNumber]/5-Int([RecordNumber]/5)=0;
-- Might well be a better way than this, but can't think just now. Too late
on a Friday afternoon... :-)

I have 10 fields in all field. They are in order lastname, firstname, case
Number, dos,units, facility, provider, rem source, ref number,. when we go
out to do an audit of records we pull every 5th record.
--
Tom


:

Tom,

Could you give an example of the data that you have, showing the way it
is
sorted, and the way you want these rows extracted.

Thanks,

Chris.

Yes I have sorded the records on field 8. I do not have a primary key.
How
would I apply a formula to field 1?
--
Tom


:

Your table should really be sorted on a field first, otherwise, there
is
no
guarantee of the order that the records will be retrieved from the
table.
What is your primary key if one is defined? and is there any way you
can
apply a formula to this field to accomplish your goal?

How can I pull every 5th line out of my database table and place
into a
new
table?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top