Solved

How to get the next record available?

Posted on 2014-11-12
4
136 Views
Last Modified: 2014-11-13
Hi,

On my page I have the applicationID passed and based on it the page information is loading.

<cfif isDefined("url.AppID")>
	<cfset AID = #url.AppID#>
<cfelse>
	<cfset AID = 1>
</cfif>

Open in new window


I have created two buttons for the next record and previous record

<input type="button" name="PreviousBtn" value="Previous">
<input type="button" name="NextBtn" value="   Next   ">

Open in new window


I just want to know how in SQL can get the next record based on the applicationID that is passed

exp:
AppID
7
55
58
60
61
62
70


so, if the url.AppID passed is 58 then when the user click on next I should take the user to record 60


here is the SQL that I need help with:

<cfquery name="AppInformation" datasource="#dsn#" username="#dbID#" password="#dbPassword#">

SELECT ApplicationID
FROM AppRepository
where ApplicationID = #AID# plus "the next record available" 

</cfquery>

Open in new window

0
Comment
Question by:lulu50
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
Philip Pinnell earned 500 total points
ID: 40437638
SELECT top 1 ApplicationID
FROM AppRepository
where ApplicationID > #AID#
order by ApplicationID
0
 
LVL 32

Expert Comment

by:awking00
ID: 40437960
select min(ApplicationID)
from AppRepository
where ApplicationID > #AID#
0
 

Author Closing Comment

by:lulu50
ID: 40440024
Thank you
0
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 40440195
Thanks
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question