![]() |
Datenbank: Access • Version: 2k • Zugriff über: ADO
SQL Abfragefeldinhalt nutzen
Hallo,
irgendwie habe ich scheinbar Tomaten auf den Augen... Wie kann ich den Inhalt eines SQL Abfragefeldes in einer anderen SQL Abfrage als Parameter weiternutzen?
Delphi-Quellcode:
Danke für alle erhellenden Hinweise (F1 hat mich bis jetzt noch nicht weiter gebracht)
var
s_emplID :string; str_sql: string; begin v3:=lb_name.KeyValue; str_sql:='SELECT '+ 'PAccounts.personalID, '+ 'PAccounts.lastYearHoliday, '+ 'PAccounts.yearHoliday, '+ 'PAccounts.yearPFree, '+ 'PAccounts.lastYearTimeAccount '+ 'FROM PAccounts '+ 'WHERE ((PAccounts.personalID)=:'+ v3 +')'; datamodule1.qry_Empl_PAccounts.Active:=False; datamodule1.qry_Empl_PAccounts.SQL.Clear; datamodule1.qry_Empl_PAccounts.SQL.Add(str_sql); datamodule1.qry_Empl_PAccounts.Active:=True; s_emplID:=datamodule1.DSource_lastYH.DataSet['lastYearHoliday'].text; <<-- geht nicht s_emplID:=datamodule1.Qry_Empl_PAccounts.FieldValues['lastYearHoliday']; <<-- geht auch nicht Dirk |
Re: SQL Abfragefeldinhalt nutzen
Delphi-Quellcode:
s_emplID:=datamodule1.Qry_Empl_PAccounts.FieldByName('lastYearHoliday').AsString;
|
Re: SQL Abfragefeldinhalt nutzen
Zitat:
Die Abfrage liefert genau einen DS. Muß ich trotzdem den ersten (und einzigen DS) ansprechen. Wenn ja wie? Dirk |
Re: SQL Abfragefeldinhalt nutzen
Wieso steht hier ein Doppelpunkt?
Zitat:
Wahrscheinlich ist die Ergebnismenge einfach nur leer. Versuch's mal ohne diesen Doppelpunkt. |
Re: SQL Abfragefeldinhalt nutzen
Zitat:
Danke noch mal Dirk |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:08 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz