Solved

Concatenate in datagrid

Posted on 2004-08-31
3
388 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

This is an explanation of a simple data model to help parse a JSON feed
This is about my first experience with programming Arduino.
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…

737 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