Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Sqlite


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Aug 3, 2016 5:07 PM Last Post By: Daniel Rogers
Daniel Rogers

Posts: 7
Registered: 2/8/12
Sqlite  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 1, 2016 4:28 PM
I are using Sqlite in an android app but are having an issue with filtering on the date.

Using the FireDac components

MyQuery is loaded with a Sql script

select Date(STiime) as SDate, STime, ETime form T1
where SDate = :FilterDate;

in mycode

var FD: TDateTime;

FD := EncodeDate(2016,7,31);

MyQuery.Param.ParamByName('FilterDate').AsDateTime := FD;
MyQuery.Open;

after some research if I remove the where statement from the Sql script so I only have

select Date(STiime) as SDate, STime, ETime form T1

The SDate coloum is empty of data.

Does Sqlite in delphi not support the formatting of TDateTime field using the Date function.

Or are I missing something else.

Daniel Rogers

Posts: 7
Registered: 2/8/12
Re: Sqlite  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 3, 2016 5:07 PM   in response to: Daniel Rogers in response to: Daniel Rogers
Daniel Rogers wrote:
I are using Sqlite in an android app but are having an issue with filtering on the date.

Using the FireDac components

MyQuery is loaded with a Sql script

select Date(STiime) as SDate, STime, ETime form T1
where SDate = :FilterDate;

in mycode

var FD: TDateTime;

FD := EncodeDate(2016,7,31);

MyQuery.Param.ParamByName('FilterDate').AsDateTime := FD;
MyQuery.Open;

after some research if I remove the where statement from the Sql script so I only have

select Date(STiime) as SDate, STime, ETime form T1

The SDate coloum is empty of data.

Does Sqlite in delphi not support the formatting of TDateTime field using the Date function.

Or are I missing something else.


Found the solution.

select Date(STiime) as SDate, STime, ETime form T1
where SDate = Date(:FilterDate);
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02