Posted by Erland Sommarskog on 07/06/07 22:00
JJ297 (nc297@yahoo.com) writes:
> 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
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
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|