?
Solved

Concatenate in datagrid

Posted on 2004-08-31
3
Medium Priority
?
401 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Accepted Solution

by:
tusharashah earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Progress

762 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