SQLite and timestamp
Posted: Fri 08 Feb 2013 00:26
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.
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.