Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old August 24th, 2006, 10:59 AM
Authorized User
Join Date: Aug 2006
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help writing SQL Statement/ .net code for function

Good morning,
I have a database (Tests) that has the following fields:
Doc_ID (Text)
Doc_Title (Text)
Test1 (yes/no)
Test2 (yes/no)
Test3 (yes/no)
Test4 (yes/no)
Test5 (yes/no)

Here is my dilema, I do not want to put the same Doc_ID (eg. doc_123) for 3 different tests to be run. (eg. Doc_123 needs Test 1, Test 3, and Test 5 to be run) Is there a SQL statement or maybe a script I can write to call to the Database for that one record to display the results 3 times on my webpage? (Instead of me creating a new Doc_Id for the same record 3 times in the Database) Does this make any sense?
thank you for your help.

  #2 (permalink)  
Old August 24th, 2006, 11:22 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

I dont understand, consider the following:

Doc_123 'MyDoc' Yes No Yes No Yes

Pulling that row from the table would tell you that Test 1 3 and 5 need to be run on that document, correct?

"The one language all programmers understand is profanity."
  #3 (permalink)  
Old August 24th, 2006, 03:31 PM
Authorized User
Join Date: Aug 2006
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts

but i need it to pull to the web form like this:
doc_123 test 1 .......
doc_123 test 3 .......
doc_123 test 5 .......

I want to write the script that goes to the database and if the record has more than 1 test then it lists them on the webpage.
Currently i have the same record in the database 3 times for 3 tests, when i could have it once using the yes/no function for the test fields.
thank you for your help

Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help writing a SQL statement kscase SQL Server 2005 3 June 24th, 2007 02:43 PM
Writing client side script in code-behind asp.net sajid_pk ADO.NET 1 January 13th, 2005 08:12 AM
writing client-side script in code-behind asp .net sajid_pk General .NET 1 January 13th, 2005 08:11 AM
Calling a Function within an MS SQL Statement flyin Classic ASP Databases 3 September 5th, 2003 03:10 AM

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