About the %d, the "Format" function expects the IMSI to be an Integer. If it is a string, put %s or a float, %f. (See "Format function" in Delphi Help files).
This should work:
With ADOQuery1 do begin
SQL.Clear;
SQL.Add('SELECT Client_Reference_Number');
SQL.Add('FROM SimCard_Details');
SQL.Add(Format('WHERE IMSI_Number = %d AND Active = Yes;',[IMSI]));
Open;
try
First;
CRN := Fields[0].asInteger;
finally
Close;
end;
end;
For the order stuff, you right, but I have much more complex queries with plenty of LEFT JOIN. By removing the ORDER BY in these complex queries and creating them, I don't get any error message. So we can suppose that the others commands are accepted. Nevertheless, my calling software is not...
Thanks for the help.
I was already trying the CREATE VIEW before but indeed it does not create a QUERY in Access. Nicsin had the good idea to try if the view is hidden somewhere. Apparently, it is the case, so thank you. Good idea!
But... (there is always a but)
I try the command : CREATE...
Hi,
As the SQL command "CREATE TABLE" allows creating a new table, I'm looking for the same kind of SQL command for creating an Access Query.
Thanks for your help,
Gad.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.