Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesHello,
the following problem:
I use Delphi 6 to access a MS Access Database.
In short, the Delphi Code looks like this:
ADOConnection1.Open;
ADOQuery1.Close;
ADOQuery1.SQL.Text :=3D 'SELECT * FROM database1 WHERE
value1=3D1 AND value2=3D ' + inttostr(array[3]);
ADOQuery1.Open;
Label5. Caption:=3DADOQuery1
. Fiel=ADdByName('valu
e4').AsString;
Now I only want to select these rows, where the Integer value3 ends on
1=2E So I need the Modulo-Function. I found in the Internet these two
functions:
MOD(x,y) und x % y
But I get an error if I want to use one.
For example, If I change
ADOQuery1.SQL.Text :=3D 'SELECT * FROM database1 WHERE
value1=3D1 AND value2=3D ' + inttostr(array[3])+' AND MOD(value3,10) =3D
1;
Delphi shows me a Syntax Error in this statement.
Thx for help!
Post Follow-up to this messageSorry, there is a ' missing in the code. But it has nothin to do with the problem: The first code runs perfectly, but If I insert AND MOD(20,10) = 0 there is the syntax error again.
Post Follow-up to this messageOn 23 Aug 2005 11:51:15 -0700, sarah18web wrote: > Sorry, there is a ' missing in the code. But it has nothin to do with > the problem: > > The first code runs perfectly, but If I insert > AND MOD(20,10) = 0 there is the syntax error again. Don't know what it might have to do with Delphi; but MOD() is not a function supported by SQL server. Only the % operator works.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread