Autor Beitrag
landwehr
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46

WIN XP, WIN 7, WIN 8
Delphi 6, Delphi 2007, Delphi XE2
BeitragVerfasst: Mo 27.06.11 10:31 
Hallo Leute,

ich greife über ADO auf 2 Tabellen mittels eines inner join zu. Nun sind in den beiden Tabellen 2 Felder mit gleichem Feldnamen. Die Feldnamen heißen dtDatum.

Wie kann ich nun die Werte der 2 Felder abfragen?

Mit Tabelle.fieldByName('dtDatum).AsDateTime erhalte ich eine Delphi Exception. Wie heißen denn nun die Felder?

Tabelle.fieldByName('dtDatum).AsDateTime --> geht nicht

Tabelle.fieldByName('dtDatum1).AsDateTime --> geht nicht

Tabelle.fieldByName('dtDatum_1).AsDateTime --> geht nicht

Tabelle.fieldByName('dtDatum(1).AsDateTime --> geht nicht


Danke für eine schnelle Antwort.

Walter
zuma
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 660
Erhaltene Danke: 21

Win XP, Win7, Win 8
D7 Enterprise, Delphi XE, Interbase (5 - XE)
BeitragVerfasst: Mo 27.06.11 10:42 
evtl. wäre es einfacher, wenn du im select die Felder schon umbenennst ?
so ala :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Select  ... alias1.Datum as Datum1, alias2.Datum as Datum2 
from tabelle alias1
inner join ... alias2 ... 
where ...

_________________
Ich habe nichts gegen Fremde. Aber diese Fremden sind nicht von hier! (Methusalix)
Warum sich Sorgen ums Leben machen? Keiner überlebts!
landwehr Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46

WIN XP, WIN 7, WIN 8
Delphi 6, Delphi 2007, Delphi XE2
BeitragVerfasst: Mo 27.06.11 10:53 
OK. Danke das funktioniert wenn es auch umständlich ist.
Walter