Solved

Addition functionality in SQL Statement?

Posted on 2008-06-12
3
1,144 Views
Last Modified: 2010-04-21
I have the following SQL Statement:

SELECT TOP 1 MORTGEE_NUMBER FROM MORTGEE ORDER BY MORTGEE_NUMBER DESC

This returns the highest "AutoNumber" in my table - MORTGEE.

I would like to add one to this number, via sql if possible, or any other suggestion.  This is an integer.

THanks,

JD
0
Comment
Question by:jamesdean666
[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
3 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 250 total points
ID: 21769645
You can try:

SELECT TOP 1 MORTGEE_NUMBER+1 FROM MORTGEE ORDER BY MORTGEE_NUMBER DESC
0
 
LVL 43

Assisted Solution

by:TimCottee
TimCottee earned 250 total points
ID: 21769648
Hello jamesdean666,

SELECT TOP 1 MORTGEE_NUMBER + 1 FROM MORTGEE ORDER BY MORTGEE_NUMBER DESC

Or

Select Max(Mortgee_Number)+1 From Mortgee


Regards,

TimCottee
0
 

Author Closing Comment

by:jamesdean666
ID: 31466557
Perfect, thanks.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.

749 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