Advertisement

08.26.2008 at 05:43PM PDT, ID: 23680586
[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.1

SQL Query problem

Asked by skrodzkim in Active Server Pages (ASP), MySQL Server

Tags: ,

I have a confusing dilema and need some help...
I am using MySQL as the database and all of my code is in ASP VBscript.
First, from data collected from the client, I insert a bunch of data into a table. The key elements for this question are the "comp_nbr",order_id" and "load_nbr" fields. When the data is inserted into the db, I check to see if any records exist that match the fields "comp_nbr" and "order_id". If yes, read field "load_nbr" and add 1 and set to "this_load" variable. If there isn't any matching records, then just assign 1 to "this_load". This variable is then used later on when the new record is added. THe problem is, if there is more than one record that matches "comp_nbr" and "order_id", only the first record field "load_nbr" is used. What I need it to do is take the last record , or the record that has the highest value for "load_nbr", and read that value into the variable (plus one, to increase the value).

Basically, in the end, my code is to take the client data that is entered and insert into db but adjusting the load number if a similar record exists. For some reason this is very difficult to explain, but I hope some of what I mentioned makes sense.

Any help would be greatly appreciated...Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Set rs3_cmd = Server.CreateObject ("ADODB.Command")
rs3_cmd.ActiveConnection = MM_USCALE_STRING
rs3_cmd.CommandText = "SELECT * FROM dticket" 
rs3_cmd.Prepared = true
 
Set rs3 = rs3_cmd.Execute
rs3_numRows = 0
 
Dim this_load
If rs3.fields.item("comp_nbr").value = Session("COMP_NBR") AND rs3.fields.item("order_id").value = Session("ORDER_ID") Then
	this_load = (rs3.fields.item("load_nbr").value) + 1
Else
	this_load = "1"
End If
 
Session("THIS_LOAD") = this_load
[+][-]08.26.2008 at 06:32PM PDT, ID: 22321124

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.

 
[+][-]08.27.2008 at 05:54AM PDT, ID: 22324166

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.

 
[+][-]08.27.2008 at 06:03AM PDT, ID: 22324236

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: Active Server Pages (ASP), MySQL Server
Tags: ASP, MYSQL
Sign Up Now!
Solution Provided By: ryancys
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.27.2008 at 06:10AM PDT, ID: 22324315

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.

 
[+][-]08.27.2008 at 06:22AM PDT, ID: 22324436

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.

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