#1 2015-07-05 09:20:25

Bojop
Member
From: Wolder
Registered: 2011-01-05
Posts: 28

DateToIso8601 changed ?

when i use DateToIso8601 in a Query, i alway's got a result

from commit 1536 I get no result any more

when I change DateToIso8601 to DateToIso8601Text and put it between "" then i get my result again.

does this mean that i had to change al my DateToIso8601 (to DateToIso8601Text and between "") or is there an issue with DateToIso8601 ?

Offline

#2 2015-07-05 14:33:55

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

Re: DateToIso8601 changed ?

???
I can't follow you.

Have you some code to reproduce the issue?

Offline

#3 2015-07-05 18:28:57

Bojop
Member
From: Wolder
Registered: 2011-01-05
Posts: 28

Re: DateToIso8601 changed ?

var
  S: RawUTF8;
  D: TDateTime;
  Info: TSQLTableJSON;

before this was OK
  S := ('Datum >= ' + DateToIso8601(D, False)       + ' and ' +
        'Datum <= ' + DateToIso8601((D + 6), False));
  Info := Server.ExecuteList([TSQLInfoTable],
        S2U('SELECT * FROM InfoTable WHERE ') + S);

Now need to use DateToIso8601Text within ""
  S := ('Datum >= "' + DateToIso8601Text(D)     + '" and ' +
        'Datum <= "' + DateToIso8601Text(D + 6) + '"');
  Info := Server.ExecuteList([TSQLInfoTable],
        S2U('SELECT * FROM InfoTable WHERE ') + S);

Offline

#4 2015-07-05 19:59:27

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

Re: DateToIso8601 changed ?

Use ? parameters

Offline

#5 2015-07-06 19:17:23

Bojop
Member
From: Wolder
Registered: 2011-01-05
Posts: 28

Re: DateToIso8601 changed ?

ab wrote:

Use ? parameters

also with ? parameters i only get a result with DateToIso8601Text

DateToIso8601 gives no result any more

Offline

#6 2015-07-06 20:33:01

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

Re: DateToIso8601 changed ?

  Info := Server.ExecuteFmt([TSQLInfoTable],
        'SELECT * FROM InfoTable WHERE Datum >= ? and Datum <= ?',[],[DateToSQL(D),DateToSQL(D+6)]);

Offline

#7 2015-07-07 16:28:12

Bojop
Member
From: Wolder
Registered: 2011-01-05
Posts: 28

Re: DateToIso8601 changed ?

ab wrote:
  Info := Server.ExecuteFmt([TSQLInfoTable],
        'SELECT * FROM InfoTable WHERE Datum >= ? and Datum <= ?',[],[DateToSQL(D),DateToSQL(D+6)]);

ehh, i cannot use ExecuteFmt like this?

the result of ExecuteFmt is Boolean, I need TSQLTableJSON

Last edited by Bojop (2015-07-08 11:44:12)

Offline

Board footer

Powered by FluxBB