Topic: Textbox value from Select with case
Hi guys,
I am struggling to write the following script to autofill an email address field if the field is empty. I keep getting errors that a ")" is missing next to the first ||
The query works well in SQLStudio if we replace the variable +name+ by an actual one.
var
email: string;
name: string;
procedure Details_OnShow (Sender: string; Action: string);
begin
Name := details.EditName.sqlValue; // get current Name
email := SQLExecute ('select firstname ||'.' || lastname || '@company.com' from users where lastname= '+name+'');
if details.EditEmail.Text<>'' then details.EditEmail.Text:= email;
end;