Hallo Leute,
Ich habe eine Tabelle "Konto" wo ich meine Kontodaten einspiele:
Id(PK), Konto, Name, KntCreationDate, KntClosingDate,DataCreation
5 , 123456 , XYZ , 01.05.2015 , NULL , 05.07.2016 07:45:00
in der weiteren Tabelle "TypeIndication" möchte ich nun festlegen, ob das Konto aus Tbl "Konto" der erste Eintrag in der Tabelle ist oder eine Änderung. Im jetzigen Fall ein Ersteintrag:
Id(PK), KontoId(FK), Indication
1, 5, E E steht für Ersteintrag
Wenn ich in weiterer Folge das Konto 123456 in die Tbl "Konto" nochmal anlege, zB. mit KntClosingDate:
Id(PK), Konto, Name, KntCreationDate, KntClosingDate,DataCreation
5 , 123456 , XYZ , 01.05.2015 , NULL , 05.07.2016 07:45:00
6 , 123456 , XYZ , 01.05.2015 , 10.05.2016 , 05.07.2016 07:50:00
Soll mir in der Tbl "TypeIndication" folgendes eingetragen werden:
Id(PK), KontoId(FK), Indication
1 , 5 , E
2 , 6 , A A steht für Änderung
Wie sieht nun mein INSERT Statement nun aus? Ich bin zu blöd um dahinter zu kommen.
Danke für eure Unterstützung.
LG
Ich habe eine Tabelle "Konto" wo ich meine Kontodaten einspiele:
Id(PK), Konto, Name, KntCreationDate, KntClosingDate,DataCreation
5 , 123456 , XYZ , 01.05.2015 , NULL , 05.07.2016 07:45:00
in der weiteren Tabelle "TypeIndication" möchte ich nun festlegen, ob das Konto aus Tbl "Konto" der erste Eintrag in der Tabelle ist oder eine Änderung. Im jetzigen Fall ein Ersteintrag:
Id(PK), KontoId(FK), Indication
1, 5, E E steht für Ersteintrag
Wenn ich in weiterer Folge das Konto 123456 in die Tbl "Konto" nochmal anlege, zB. mit KntClosingDate:
Id(PK), Konto, Name, KntCreationDate, KntClosingDate,DataCreation
5 , 123456 , XYZ , 01.05.2015 , NULL , 05.07.2016 07:45:00
6 , 123456 , XYZ , 01.05.2015 , 10.05.2016 , 05.07.2016 07:50:00
Soll mir in der Tbl "TypeIndication" folgendes eingetragen werden:
Id(PK), KontoId(FK), Indication
1 , 5 , E
2 , 6 , A A steht für Änderung
Wie sieht nun mein INSERT Statement nun aus? Ich bin zu blöd um dahinter zu kommen.
Danke für eure Unterstützung.
LG