all groups > sql server (alternate) > july 2007 >
You're in the

sql server (alternate)

group:

Help writing an If else statement


Help writing an If else statement JJ297
7/6/2007 10:46:13 AM
sql server (alternate):
Hello I'm a newbie to programming and need help writing an if
statement.

I have a database set up in SQL with the following fields:

Category Questions Answers

I only want one category to appear for all of the questions and
answers submitted for that category. The way I have it set up now all
if a question is submitted for the same category then the category
will list twice and a one question under each other.

How do I write something if I Dim Category

If it's the same category but a different question just list that
question under that category. If it's a new category list that
category and the questions and answers under that
Re: Help writing an If else statement Ed Murphy
7/6/2007 6:31:18 PM
[quoted text, click to view]

This sounds like it should be done in a separate reporting
Re: Help writing an If else statement Erland Sommarskog
7/6/2007 10:00:36 PM
JJ297 (nc297@yahoo.com) writes:
[quoted text, click to view]

I am afraid that I can only answer with the standard recommendation that
you post:

o CREATE TABLE statements for your table(s).
o INSERT statement with sample data.
o The desired output given the sample.

This helps to clarify what you are asking (which I currently do not
understand), and also makes it easy to develop a tested solution.



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
Re: Help writing an If else statement --CELKO--
7/8/2007 7:00:36 AM
Why are you formatting data in the back end? The basic principle of a
tiered architecture is that display is done in the front end and never
in the back end. This a more basic programming principle than just
SQL and RDBMS.


AddThis Social Bookmark Button