Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 September 10th, 2007, 10:24 PM
Registered User
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Formatting Database Output

Hey All,

I have a query that i have been having trouble with for some weeks and i am desperate to get working.

What i want to do is construct a statement from the values i pull from the database.

for example, i have 2 rows in the database, one field, called dbValue that has the values "Value 1" and "Value 2"

I want to pull the values from the database and construct an if statement like the following

if testing = Value 1 OR Value 2 then
else
end if

Could someone please help me out, the values have to be pulled from the database as they will be dynamic.

Pleaseeeeeeee Helppppppppp

 
Old September 11th, 2007, 01:26 AM
Registered User
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Anyone?

 
Old September 19th, 2007, 05:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you are new to sql query/asp. it will more better that you visit this site
http://www.w3schools.com





 
Old September 25th, 2007, 05:08 AM
Authorized User
 
Join Date: Dec 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In this type of query u should use case.

Select (case testing when 'Value1' then 'somecode' else 'anothercode' end) as Result
From Table

Try this.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting Time Output braunj ASP.NET 2.0 Basics 0 October 6th, 2008 10:27 PM
Output Formatting Neal XSLT 2 October 12th, 2006 05:12 AM
Formatting TextBox bound to a database column Raby Visual Basic 2005 Basics 1 September 6th, 2006 07:47 PM
ASP to Excel - excel output formatting issue mat41 Classic ASP Professional 0 August 13th, 2006 06:41 AM
Formatting Output Colonel Angus SQL Server 2000 3 September 1st, 2004 10:35 AM





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