 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 29th, 2004, 08:56 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Good morning bmains;
I want to thank yo for all your help! The code works fine but it's displaying all the ticket numbers from Ticket_Number table. What I'm trying to do is to have the user fill out that form then on the confirmation page print out a ticket number from the database. For example This user would be number 10. It would grab that number from the sql database then print out on the confirmation page.
Again thank you !
|
|

June 29th, 2004, 10:49 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hello,
You have to limit the query with the where clause then, based on some parameter. I'm a little confused. Are you inserting a user request into the database and then grabbing the identity value? If so, basically you would do the insert, and then do a:
SELECT max(Ticket_Number) FROM Escalation_Forms where UserID = '" & strUserID & "'"
Brian
|
|

June 29th, 2004, 11:13 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No the user fills out the form hit submit then the confirmation page displays the highest or a unique ticket number from the database.
Ralph
|
|

June 29th, 2004, 11:28 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hello,
So would the previous query work? Are the ticket numbers already created before this? Does the request get inserted into the database and the Ticket_number is a identity field?
Sorry, I'm having trouble following along.
Brian
|
|

June 29th, 2004, 11:39 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The Ticket number already created in the data base! I try to get to display only one ticket number from the database or the highest ticket number:
Her the result I am getting:
Form confirmation
Thank you for submitting the following information!
Your Ticket Number is:
85
86
90
96
99
104
87
88
94
102
103
105
106
89
92
93
95
97
101
91
98
100
Date of Request: Tuesday, June 29, 2004
|
|

June 29th, 2004, 11:42 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Selecting the highest number is easy then, do:
SELECT max(Ticket_Number) FROM Escalation_Forms
You have to delete the ticket number from the table or else it will always be the highest.
Brian
|
|

June 29th, 2004, 03:49 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Bmains;
I want to say thank you for walking me through this problem I had!
God bless!
Ralph
|
|
 |