🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2598

Re: SQL SELECT -- Combine 2 columns

#2598
From: Rainer Welzel
Date: Sun, 20 Apr 2003 16:42
100 lines
4298 bytes
Hi Viatcheslav ,
your right, it must something with the Fieldnames.
Here my used Fieldnames:

Fieldname => NachName, Typ => Text , Comment => Surname of Individual.  Use
Maiden name for women.
Fieldname => VorName, Typ => Text , Comment => Name of the Individual

it doesn't works. In the DBGrid I see only the first Field.

I tray an other pair of the above table.
Fieldname => BirthDate, Typ => Text , Comment => Date of Birth.
Fieldname => BirtPlac, Typ => Text , Comment => Place of Birth

In the StringList Editor of the ADOQuery Component the Statement:

SELECT BirthDate + ", " + BirthPlac AS  Birth FROM tblIndividual
works very well -- I see two Fields in the DBGrid :
----------------------------------------------------------------------------
--
If there some Information on  special keywords for Fieldnames ???

Thank you for your help.

Rainer


"Viatcheslav V. Vassiliev" <support@oledbdirect.com> schrieb im Newsbeitrag
news:3ea24fdc@newsgroups.borland.com...
> What error do you have? Note that Name is special keyword and use:
>
> Select [Name], ([City] + ', ' + [Country]) as [Location] from [tblIndy]
>
> If City or Country is not string column, use
>
> Select [Name], (CStr([City]) + ', ' + CStr([Country])) as [Location] from
> [tblIndy]
>
> If this does not help, install latest MDAC and Jet SP.
>
> ----------------------------------------------------------------
> Regards,
> Viatcheslav V. Vassiliev
> http://www.oledbdirect.com
> The fastest way to access MS SQL Server, MS Jet (MS Access)
> and Interbase (through OLEDB) databases.
>
> "Rainer Welzel" <rainer@fgg-welzel.de> �������/�������� � ��������
> ���������: news:3ea23628@newsgroups.borland.com...
> > This doesn't works.
> > I use Jet 4.0
> > with a ADOQuery and a DBGrid.
> >
> > rainer
> >
> > "Viatcheslav V. Vassiliev" <support@oledbdirect.com> schrieb im
> Newsbeitrag
> > news:3ea14f97@newsgroups.borland.com...
> > > This depends on your DBMS. In MS SQL Server use (pubs db):
> > >
> > > Select (au_lname + ', ' + au_fname) as [name] from authors
> > >
> > > ----------------------------------------------------------------
> > > Regards,
> > > Viatcheslav V. Vassiliev
> > > http://www.oledbdirect.com
> > > The fastest way to access MS SQL Server, MS Jet (MS Access)
> > > and Interbase (through OLEDB) databases.
> > >
> > > "Rainer Welzel" <rainer@fgg-welzel.de> �������/�������� � ��������
> > > ���������: news:3ea14b69@newsgroups.borland.com...
> > > > Hi ,
> > > > I failed to combine 2 fields  with the following statement:
> > > >
> > > > ADOQueryIND->SQL->Add("SELECT Name, City & ', ' & Country AS
Location
> > FROM
> > > > tblIndi");
> > > >
> > > > also
> > > >
> > > > ADOQueryIND->SQL->Add("SELECT Name, City || ', ' || Country AS
> Location
> > > FROM
> > > > tblIndi");
> > > >
> > > > this statement failed.
> > > >
> > > > Have anybody the right syntax ??
> > > >
> > > > thx rainer
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <3ea3892b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!c03.atl99!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3ea14b69@newsgroups.borland.com> <3ea14f97@newsgroups.borland.com> <3ea23628@newsgroups.borland.com> <3ea24fdc@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,2ea9fd8801400070
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-04-20 23:04:30 PST
From: "Rainer Welzel" <rainer@fgg-welzel.de>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3ea14b69@newsgroups.borland.com> <3ea14f97@newsgroups.borland.com> <3ea23628@newsgroups.borland.com> <3ea24fdc@newsgroups.borland.com>
Subject: Re: SQL SELECT -- Combine 2 columns
Date: Sun, 20 Apr 2003 18:42:59 +0200
Lines: 102
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 217.83.170.208
Message-ID: <3ea3892b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1050904875 217.83.170.208 (20 Apr 2003 23:01:15 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!c03.atl99!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail