Wrox Programmer Forums
|
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
 
Old June 29th, 2004, 08:56 AM
Authorized User
 
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 !

 
Old June 29th, 2004, 10:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
 
Old June 29th, 2004, 11:13 AM
Authorized User
 
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old June 29th, 2004, 11:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
 
Old June 29th, 2004, 11:39 AM
Authorized User
 
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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



 
Old June 29th, 2004, 11:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
 
Old June 29th, 2004, 03:49 PM
Authorized User
 
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Bmains;

I want to say thank you for walking me through this problem I had!

God bless!

Ralph






Similar Threads
Thread Thread Starter Forum Replies Last Post
Building my own ticket tracker cf2006 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 August 31st, 2006 11:04 AM
retrieving from database... URGENT!!! roryosullivan JSP Basics 1 March 9th, 2005 03:11 PM
NEED HELP! retrieving from database nvillare .NET Web Services 5 October 22nd, 2004 12:37 AM
problem retrieving from database rajuru Beginning PHP 2 October 8th, 2004 12:34 PM
NEED HELP! retrieving from database nvillare ADO.NET 1 December 2nd, 2003 10:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.