Narendra Pal
Narendra Pal

Reputation: 6604

Sqlite query to convert string to date in sqlite?

I have date in string format in the table in yyyy-mm-dd format. I want to convert that string to date format for further comparision on the date.

Any help would be greatful..

Upvotes: 0

Views: 1482

Answers (2)

Narendra Pal
Narendra Pal

Reputation: 6604

I got the query of this. SqlLite compares difference between two string date directly.

select column from Table where columnDate between '2012-07-01' and '2012-07-07'

But thanks for your interest guys.

Upvotes: 0

KV Prajapati
KV Prajapati

Reputation: 94625

I'd suggest you to use SQLite - DateTime functions to compare field data value. Alternately you can use java.text.SimpleDateFormat class's parse method to convert string date to Date type.

Upvotes: 1

Related Questions