Advertisement

05.27.2008 at 09:43AM PDT, ID: 23435457
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

need guidance on SQL Stored procedure syntax

Asked by CASorter in SQL Query Syntax, MS SQL Server, SQL Server 2005

Tags: ,

I need some help if you have a second, minute, chunk of time, can you give me some guidance.

Here is what I want


I want to roll back a number, basically do a wrap,  problem is the field is rolling,  let me describe in a series of examples


Day 1
Sequence          561,562,563,564,565&..  763,764,765      high number 765, low number 561

Day 2
Old numbers dropped, new numbers added
Sequence      697,698,699,700&..  777,778,779,780      high number 780, low 697

Day 3
More old numbers dropped, more new numbers added
Sequence      719,720,721,722&.792,793,794


When the high number gets to 999 I want to wrap it back down so that the lowest number in the sequence is 1 and the highest is 1+the difference between the two ends of the number line..


So
951,952,953,954&.997,998,999
Would become   1,2,3,4&47,48,49


The range is not guaranteed, so it may be
917,918,919&997,998,999
To
1,2,3,4&.81,82,83


This is to keep the numbers in the same relative order, but reduce the value of the number

The math involved is

NewNumber=CurrentNumber-(OriginalLowNumber-1)

Then we have to set a field in the profile that keeps track of the hightest number to the new high number


So what we would have to do
1.      Look up the lowest,positive Number   (select top 1 Number from Table where Number>0 order by Number)
2.      Read through the table and update the Number field (Update Table set Number = Number-((result of step 1)  - 1)
3.      Look up the new, highest Number (select top 1 Number from table order by Number desc)  OR keep track of the high number
4.      Update the profile      (update Profile set HighNumber = (result of step 3)


basically, what i need is some quidance on syntax to accomplish this.

thanks!

Start Free Trial
 
Loading Advertisement...
 
[+][-]05.27.2008 at 11:00AM PDT, ID: 21654081

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.27.2008 at 11:16AM PDT, ID: 21654244

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.27.2008 at 11:32AM PDT, ID: 21654362

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, MS SQL Server, SQL Server 2005
Tags: SQL 2000, stored procedure
Sign Up Now!
Solution Provided By: mark_wills
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.27.2008 at 12:09PM PDT, ID: 21654651

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.27.2008 at 01:25PM PDT, ID: 21655383

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 14-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.27.2008 at 07:23PM PDT, ID: 21657286

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.28.2008 at 07:58AM PDT, ID: 21660996

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628