Print Page | Close Window

Displaying (more) Conditional Database Data

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=27086
Printed Date: 28 March 2026 at 5:31pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Displaying (more) Conditional Database Data
Posted By: kennywhite
Subject: Displaying (more) Conditional Database Data
Date Posted: 09 March 2009 at 3:44pm
Hello,
 
 My original question was answered in this topic http://forums.webwiz.net/forum_posts.asp?TID=27045&PID=138615#138615" rel="nofollow - http://forums.webwiz.net/forum_posts.asp?TID=27045&PID=138615#138615
 
But now I am trying to find a way to display data based on the information entered into two columns instead of just one.
 
I have tried:
 
SELECT * FROM table_name WHERE field_name = 'DEPARMENT A', WHERE field_name = 'PRODUCT_TYPE B';
 
I've also tried it without the comma, without the second  "WHERE" and every variation that I could think of.
 
Can anyone help me out?
 
Thanks!
 
 



Replies:
Posted By: WebWiz-Bruce
Date Posted: 09 March 2009 at 4:13pm
You would use AND or OR

eg:-

SELECT * FROM table_name WHERE field_name = 'DEPARMENT A' AND field_name = 'PRODUCT_TYPE B';

SELECT * FROM table_name WHERE field_name = 'DEPARMENT A' OR field_name = 'PRODUCT_TYPE B';


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net