Solved

Concatenate in datagrid

Posted on 2004-08-31
3
361 Views
Last Modified: 2008-03-06
I have a table which has the following fields

Prefix
SheetNumber
WhatFor
ApprovalDate
FabricationDate

If I have two records which both have the same prefix and sheet number but have different WhatFor I only want to display 1 of the records.

Table
Prefix    SheetNumber      WhatFor           Approval Date   Fabrication Date
Ar            100                Approval                01/01/01           01/02/01
AR           100                Fabrication             01/01/01           01/02/01

Datagrid
Prefix      SheetNumber     Approval Date   Fabrication Date
AR               100                  01/01/01          01/02/01

Both records represent the same sheet which will have two records one for approval and one for fabrication, however for this particular datagrid I only need to display the record one time because they have the same dates and whatfor is irrelavent.
0
Comment
Question by:MarkWP
3 Comments
 
LVL 18

Accepted Solution

by:
tusharashah earned 500 total points
ID: 11943100
If you do not need field 'WhatFor' in datagrid, then you can write your query for retriving data like:

>>> "SELECT DISTINCT PREFIX, SheetNumber, ApprovalDate, FabricationDate FROM [TABLE]"

Use of distinct keyword will give you only 1 Record instead of 2.

-tushar

0
 
LVL 3

Expert Comment

by:aravindtj
ID: 11943444

Hi,
try this query,

SELECT DISTINCT Prefix, SheetNumber,  Approval Date,   Fabrication Date FROM <you table name> a, <you table name> b where a.Prefix = b.Prefis and a.SheetNumber = b.SheetNumber and a.WhatFor != b.WhatFor;

All the best.
0
 
LVL 1

Author Comment

by:MarkWP
ID: 11945506
Thanks To All
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question