Solved

Addition functionality in SQL Statement?

Posted on 2008-06-12
3
1,141 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
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

832 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