Hi. I'm using Delphi 7, UniDac 4.6.11 and Sqlite provider.
I have in my database a field with timestamp and I'm not getting decode this field. All registers has this field starting with YYYY-MM and my query get the records from a specific year and month. The query works with SQL server but not with Unidac. My question is: what is the best way to get all records that starting with YYYY-MM? I tried compare with a variable string and % but no success.
The string to be used is created with:
if ComboBox1.ItemIndex < 10 then
begin
strIndice := '0'+IntToStr(ComboBox1.ItemIndex)
end
else
begin
strIndice := IntToStr(ComboBox1.ItemIndex)
end;
strSelect := combobox2.text + '-' +strIndice;
I'd like use strselect% in the query. Any idea?
Thanks in advance.
SQLite and timestamp
Re: SQLite and timestamp
hello,
If you use a TIMESTAMP field, you can add a comparison to the WHERE section in the following way:
If you use a TIMESTAMP field, you can add a comparison to the WHERE section in the following way:
Code: Select all
UniQuery1.AddWhere('field_name like + ''' + strselect + '%''');
Re: SQLite and timestamp
Alex, thank you, the query is running ok now.
Re: SQLite and timestamp
Hello,
Glad to see that the problem was solved. If you have any other questions, feel free to contact us.
Glad to see that the problem was solved. If you have any other questions, feel free to contact us.