Avatar of rito1
rito1

asked on 

SELECT TOP 1 Returning more than 1 record - MS Access

Hi All,

Can anyone see why the following SQL would ignore my request of only returning 1 record and returns multiple records in MS Access?

Many thanks,

Rit


SELECT TOP 1 tblQuestions.questionID AS nextQuestionID
FROM tblQuestions
WHERE (((tblQuestions.questionID)>[paramQuestionID]) AND ((tblQuestions.removed)=0))
ORDER BY tblQuestions.Seqorder;

Open in new window

Microsoft AccessSQL

Avatar of undefined
Last Comment
Gustav Brock
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of simonpaul64
simonpaul64

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of simonpaul64
simonpaul64

SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of rito1
rito1

ASKER

It seems to be because there are multiple instances of the Seqorder value. But this has been implemented by design. But I only want the first one it comes across :-(
Avatar of simonpaul64
simonpaul64

Yes that would be exactly right - since you only want the first one it comes across, is the order important on Seqorder value?
SOLUTION
Avatar of dqmq
dqmq
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of rito1
rito1

ASKER

Thanks all. I sorted this issue out last night (not that I can remember how exactly now) :-)
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

I guess you used the solution above!

/gustav
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo