#1 2015-06-03 10:15:32

noobies
Member
Registered: 2011-09-13
Posts: 139

FormatUTF8

try modernize code ClientRest.ExecuteList([], s) with FormatUTF8 (executelist need - have several commands inner join)
old part code (work fine):

Result := Result + 'strftime("%Y", InputDate) = ' + cbbCurrentYear.Value.QuotedString

if change old part to new part code not work:

Result := Result + FormatUTF8('strftime("%Y", InputDate) = ?', [], [cbbCurrentYear.Value]);

if result i see: ' strftime("Y", InputDate) = ?'. any idea how format sql with expression?

Offline

#2 2015-06-03 14:44:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: FormatUTF8

Use %% within strftime("%Y",...)

Offline

#3 2015-06-04 07:13:48

noobies
Member
Registered: 2011-09-13
Posts: 139

Re: FormatUTF8

change to

Result := Result + FormatUTF8('strftime("%%Y", InputDate) = ?', [], [cbbCurrentYear.Value]);

and not work, in result: ' strftime("%Y", InputDate) = ?'

FormatUTF8 dont parse string with %% and dont change ? to

:(''2015''):

if i remove % all parse ok, but strftime not work, i think it but in FormatUTF8

Last edited by noobies (2015-06-04 07:14:16)

Offline

#4 2015-06-04 07:39:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: FormatUTF8

Please try

Result := Result + FormatUTF8('strftime("%Y", InputDate) = ?', ['%'], [cbbCurrentYear.Value]);

Offline

#5 2015-06-04 07:46:27

noobies
Member
Registered: 2011-09-13
Posts: 139

Re: FormatUTF8

ab, big thanks it work!

Offline

Board footer

Powered by FluxBB