I apologize to the member of sqlite-user if my question is not very intelligent, but i'm new with sqlite. For this it is very difficult for me, specially when there is some user that become talk with Rule 1, Rule 2 rule 3 rule4. In those moment born the desidere to change database. But in this moment i have not other chance. I must use sqlite. I want express gratitude to Olaf Schmidt, that he is a great professional and available with everybody specially with ignorant people such me!!!!!
That said, nevertheless the advise of everybody, the query with datetime format no work. The following code (after Olaf Schmidt advice does not in error but the query no return data): Dim ds As Dataset Dim ieri As String Dim ieri_inizio As String Dim ieri_fine As String ieri = Date ieri_inizio = ieri & " 00:00:00" ieri_fine = ieri & " 23:59:59" ieri_inizio = Format(ieri_inizio, "'yyyy-mm-dd hh:nn:ss'") ieri_fine = Format(ieri_fine, "'yyyy-mm-dd hh:nn:ss'") Set ds = m_db.Execute("SELECT * FROM tabella WHERE data_ora BETWEEN " & ieri_inizio & " and " & ieri_fine & " ORDER BY data_ora") I have tryed to replace Format with STRFTIME but VB6 go in error because it no recognize this function!!!! Then i have changed the format to datetime to text and with the following code for magic it work perfectly: Dim ds As Dataset Dim ieri As String Dim ieri_inizio As String Dim ieri_fine As String ieri_inizio = "'11/10/2008 00:00:00'" ieri_fine = "'11/10/2008 23:59:59'" Set ds = m_db.Execute("SELECT * FROM tabella WHERE data_ora BETWEEN " & ieri_inizio & " and " & ieri_fine & " ORDER BY data_ora") That said, i have solved my problem, but i'm like to understand why it no work with datetime format. If there is somebody that explain me with simply word i thanks he!!!!! Best regards -- Fabio Stranieri _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users