UniDac 4.1.5 Problem - Bug?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ASKtec
Posts: 11
Joined: Thu 29 Jan 2009 14:52

UniDac 4.1.5 Problem - Bug?

Post by ASKtec » Sat 31 Mar 2012 22:35

Hello,

the following SQL-Statement will work with Unidac 4.1.4 tested in Delphi 2007 but not with Unidac 4.1.5 in Delphi XE2 Update 4:

SELECT m.id, m.datei, DATE_FORMAT(max(l.zeit),"%d.%m.%Y %T") as zeit
from motiv m join logging l on (m.datei = l.datei)
where kid = '1' and l.aktion = 'close'
group by id, datei order by id asc

I get this error: #42S22Unknown column '%d.%m.%Y %T' in 'field list'

Tested with mySQL...

Kind regards
Andreas

skalka
Posts: 2
Joined: Sat 31 Mar 2012 19:09

Post by skalka » Sun 01 Apr 2012 18:41

First idea: use single quotes, not double in text

so '%d.%m.%Y %T' instead of "%d.%m.%Y %T" ...


greets
sk

AndreyZ

Post by AndreyZ » Tue 03 Apr 2012 11:11

To solve the problem, you should replace double quotes in your query with the pair of single quotes. Here is a code example:

Code: Select all

UniQuery.SQL.Text := 'SELECT DATE_FORMAT(max(l.zeit),''%d.%m.%Y %T'') as zeit from motiv m';

Post Reply