Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In Delphi 2010, when executing the below query, it displays the "Type mismatch in expression" error . But when I run the same query in Interbase, query executed and displaying the records.

Why it is not executing from software??

What I have tried:

Query:
SQL
select distinct 'D' x,76 Dlid, Seqno, DLYear, LTime, SigNo , DSigStatus , DDLCS, DRIGS from DIGDATA76  where DRIGS <> -1 and ((( DLYEAR = 2018) And ( LTime > 756141126) or (DLYEAR > 2018)) and ((DLYEAR = 2018 ) And
( LTime <= 761732473) or ( DLYEAR < 2018))) Union All select distinct 'A' x,76 Dlid, Seqno, DLYear, LTime, ASigNo, ASigno AVoltage, LTime DDLCS, LTime DRIGS from ANGDATA76  where ((( DLYEAR = 2018) And ( LTime > 756141126)
 or (DLYEAR > 2018)) and ((DLYEAR = 2018 ) And ( LTime <= 761732473) or ( DLYEAR < 2018))) Union All select distinct 'M' x,76 Dlid, Seqno, DLYear, LTime, MByte89, MByteAB a, LTime DDLCS, LTIME DRIGS from MDATA76
  where  ((( DLYEAR = 2018) And ( LTime > 756141126) or (DLYEAR > 2018)) and ((DLYEAR = 2018 ) And ( LTime <= 761732473) or ( DLYEAR < 2018))) order by 4, 5, 3
Posted
Updated 22-May-18 2:25am
v3
Comments
[no name] 22-May-18 8:23am    
How do you Access the database from your code?
a.) BDE
b.) FireDAC
c.) dbExpress
d.) ADO?
others?
Member 13838888 22-May-18 8:29am    
BDE
[no name] 22-May-18 8:32am    
Are you sure that the bde is configured to SQLQRYMODE=SERVERrespectively configure it explicitely and try again.
Member 13838888 23-May-18 3:37am    
Can u plz tell me how to set SQLQRYMODE = SERVER??
[no name] 23-May-18 3:41am    
I'm sure you now the property Params from TDatabase. You can simply add SQLQRYMODE = SERVER there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900