Link to home
Start Free TrialLog in
Avatar of gagnonmv
gagnonmvFlag for United States of America

asked on

SelectCommand Issue with ASP.Net

I have a SelectCommand with Distinct in it but it continues to pull all records within a record set but I only want the first record of the record set displayed on the screen.  Each record set can have up to 50 records with a unique id, but the same sub number (aaid) in the record set.  The sub number relates to a header table.

Example (ID = Unique, AAID = SubNumber)
ID AAID
1  10
2  10
3  10
4  10
5  11
6  11
7  11
8  12
9  12
and so.

So within my aspx page I have the following SelectCommand:
SelectCommand="SELECT DISTINCT [AAID], [ID], [DOCLOAD_SEC1], [TRANS_CODE], [HEADER_DESCRIPTION], [LINE_NO], [TRANS_TYPE], [BEG_BFY], [ORGN], [OBJ_REV_SRCE], [JOB_NUMBER], [FUND], [PGMT], [VENDOR_ID], [LINE_AMOUNT], [EMAIL_ADDRESS_OF_SUBMITTER], [DATE_SUBMITTED] FROM [AA_DETAIL] WHERE ([DOCLOAD_SEC1] = @DOCLOAD_SEC1) AND ([LAST_MODIFY_USER] IS NULL) ORDER BY [AAID]">

Thanks for the assist.
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gagnonmv

ASKER

AWESOME, Thanks