Return only the 1st and 10th record in a Recordset

E

Eka1618

Hello,

I am using the following query (qryTorqueTestReportResults):

SELECT tblResults.Q_INC, tblResults.SAMPLE_NO, tblResults.FAILED_AT,
tblResults.P_F, tblResults.FAIL_LEVEL, tblResults.ON_OFF,
tblResults.FAIL_TORQ, tblResults.PASS_VALUE, tblResults.TENSION,
tblResults.NOTES, tblResults.OBSERVATIONS, tblResults.L_PART_NO,
tblResults.K_PART_NO, tblResults.PAT_NO, tblResults.PAT_SIZE,
tblResults.FAIL_TRQ_LEVEL, tblResults.SHROUD_OVAL, tblResults.L_ID,
tblResults.K_ID, tblResults.L_FAILURE_MODE, tblResults.K_FAILURE_MODE
FROM tblResults
WHERE (((tblResults.[K_ID])=[Reports].[rptTorqueTestReport].[K_ID])) OR
((([K_ID]=[Reports].[rptTorqueTestReport].[K_ID]) Is Null));


This is used for a subReport in my one report named rptTestReport. The
Master/Child link is: Q_INC;L_ID

This method returns all the records that meet these conditions, however, I
only want to report on the 1st and 10th record. I am not sure how I can do
this. If anyone has any suggestions, please let me know.

Thank You!
 
R

Roger Carlson

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "NumberedQuery.mdb " which illustrates how create a numbering
sequence for your query. You can find it here:
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=309

To that, all you would add a Where clause to return only record 1 and 10.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
E

Eka1618

I have been looking up more information about this, I think I should clarify
what it is that I need exactly...

My query is going to return x number of records. In my report. Each record
that is returned is going to have it's own set of results from this query
(This is where my subReport comes in).

I have read about making sure if the records are in sequence, but I am not
sure if they will be or not. I have an autonumber on tblResults, but I guess
I do not know enough about this situation to determine if I can use a simple
solution like this:

Field: [LeisureID] mod 7
Show: uncheck this box
Criteria: 7


I don't think I can. I do not really understand this method fully I guess.

Any help would be appreciated, Thank You!
 
E

Eka1618

Thanks for the code Roger,

This is going to solve part of my problem. I looked at the report design a
little further, and I need to return my results like this:

SAMPLE NUMBER | Tension at 1st | Tension at 10th ...

Tension at 1st is that first record, and Tention at 10th is the 10th record.
So, I think I need to create 2 seperate queries; one to find the first, one
to find the 10th, Then use these, also with the original query (atleast those
parameters anyway) to have my report display what I need...

Sorry if this is complicated, but they just want to report the decrease in
"Tension" between the 1st and 10th record for each result that has the same
Q_INC,L_ID and K_ID in tblResults (This is where my original parameters come
in).

I am not going to display each record with its results like I originally
said I was going to, so this changes my parameters and I will probably only
need to use the Master/Child link as: Q_INC and the rest of what i need to do
would be in the query I suppose.

I am confusing myself...lol

If you have anymore suggestions, please let me know. Thank you!

--
~Erica~


Roger Carlson said:
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "NumberedQuery.mdb " which illustrates how create a numbering
sequence for your query. You can find it here:
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=309

To that, all you would add a Where clause to return only record 1 and 10.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
Eka1618 said:
Hello,

I am using the following query (qryTorqueTestReportResults):

SELECT tblResults.Q_INC, tblResults.SAMPLE_NO, tblResults.FAILED_AT,
tblResults.P_F, tblResults.FAIL_LEVEL, tblResults.ON_OFF,
tblResults.FAIL_TORQ, tblResults.PASS_VALUE, tblResults.TENSION,
tblResults.NOTES, tblResults.OBSERVATIONS, tblResults.L_PART_NO,
tblResults.K_PART_NO, tblResults.PAT_NO, tblResults.PAT_SIZE,
tblResults.FAIL_TRQ_LEVEL, tblResults.SHROUD_OVAL, tblResults.L_ID,
tblResults.K_ID, tblResults.L_FAILURE_MODE, tblResults.K_FAILURE_MODE
FROM tblResults
WHERE (((tblResults.[K_ID])=[Reports].[rptTorqueTestReport].[K_ID])) OR
((([K_ID]=[Reports].[rptTorqueTestReport].[K_ID]) Is Null));


This is used for a subReport in my one report named rptTestReport. The
Master/Child link is: Q_INC;L_ID

This method returns all the records that meet these conditions, however, I
only want to report on the 1st and 10th record. I am not sure how I can do
this. If anyone has any suggestions, please let me know.

Thank You!
 
E

Eka1618

Please just disregard everything i just put... the report design is being
updated and is going to be changing.

Thanks again roger, because I definitley think that your example will help
me.
--
~Erica~


Eka1618 said:
Thanks for the code Roger,

This is going to solve part of my problem. I looked at the report design a
little further, and I need to return my results like this:

SAMPLE NUMBER | Tension at 1st | Tension at 10th ...

Tension at 1st is that first record, and Tention at 10th is the 10th record.
So, I think I need to create 2 seperate queries; one to find the first, one
to find the 10th, Then use these, also with the original query (atleast those
parameters anyway) to have my report display what I need...

Sorry if this is complicated, but they just want to report the decrease in
"Tension" between the 1st and 10th record for each result that has the same
Q_INC,L_ID and K_ID in tblResults (This is where my original parameters come
in).

I am not going to display each record with its results like I originally
said I was going to, so this changes my parameters and I will probably only
need to use the Master/Child link as: Q_INC and the rest of what i need to do
would be in the query I suppose.

I am confusing myself...lol

If you have anymore suggestions, please let me know. Thank you!

--
~Erica~


Roger Carlson said:
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "NumberedQuery.mdb " which illustrates how create a numbering
sequence for your query. You can find it here:
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=309

To that, all you would add a Where clause to return only record 1 and 10.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
Eka1618 said:
Hello,

I am using the following query (qryTorqueTestReportResults):

SELECT tblResults.Q_INC, tblResults.SAMPLE_NO, tblResults.FAILED_AT,
tblResults.P_F, tblResults.FAIL_LEVEL, tblResults.ON_OFF,
tblResults.FAIL_TORQ, tblResults.PASS_VALUE, tblResults.TENSION,
tblResults.NOTES, tblResults.OBSERVATIONS, tblResults.L_PART_NO,
tblResults.K_PART_NO, tblResults.PAT_NO, tblResults.PAT_SIZE,
tblResults.FAIL_TRQ_LEVEL, tblResults.SHROUD_OVAL, tblResults.L_ID,
tblResults.K_ID, tblResults.L_FAILURE_MODE, tblResults.K_FAILURE_MODE
FROM tblResults
WHERE (((tblResults.[K_ID])=[Reports].[rptTorqueTestReport].[K_ID])) OR
((([K_ID]=[Reports].[rptTorqueTestReport].[K_ID]) Is Null));


This is used for a subReport in my one report named rptTestReport. The
Master/Child link is: Q_INC;L_ID

This method returns all the records that meet these conditions, however, I
only want to report on the 1st and 10th record. I am not sure how I can do
this. If anyone has any suggestions, please let me know.

Thank You!
 

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

Top