user578332
user578332

Reputation: 345

combine two columns with Firedac or Unidac

I use FDquery(Firedac), Uniquery(UNidac) to query ms access database on delphi. select asset &" - "& asset_n as nooot from t_komp. this query combines two columns without "-" sign. enter image description here

NOTE: if I use ADoquery, this query works well.

Upvotes: 0

Views: 101

Answers (1)

fisi-pjm
fisi-pjm

Reputation: 609

The failure might be due to using the character & employed by FireDAC to identify a macro: FireDAC Preprocessing Command Text - Substitution Variables.

You can try two approaches:

  1. Set ResourceOptions.MacroExpands to false.

  2. Modify your SQL query, depending on your DBMS, to:

    select CONCAT(asset,' - ',asset_n) as nooot from t_komp
    

    or

    select CONCAT(CONCAT(asset,' - '),asset_n) as nooot from t_komp
    

Upvotes: 1

Related Questions