1
Answer

How to select items with respect to date only in sqlite?

Abhilash J A

Abhilash J A

8y
692
1

Hello Everyone, 

I have to select all rows from database by just passing only date. For example to get all rows that I am passing date only this format: 11/9/2016

In sqlite db I store this in DATETIME format column: Eg: 11/9/2016 6:44:46 PM

 I have tried to get by using date() but I get nothing for date:
 
  1. sql = "SELECT * FROM Tble_UserSetUp inner join Tble_Login on Tble_UserSetUp.Id = Tble_Login.UserId WHERE Tble_Login.UserId='" + UserID + "' and Tble_Login.LogInTime = date('" + AccessDate + "') or Tble_Login.LogOutTime = date('" + AccessDate + "')";  
So all I need is to compare only dates but can't find how to do this in sqlite. But it return null data.
 

 
Answers (1)