I am struck with a problem. I have used sqlite3 for inserting, saving and retrieving data. I am aware of the query to retrieve data, i.e
SELECT * from tableName.
But I have a date saved for every reminder and the format I saved was @”MMMM dd”, it is saved as January 23,March 14 etc. It’s actually in a from that contains a row with textfield. When clicked a date picker appears,with date, month and year. But after selecting the date format displayed would be as mentioned!
I have successfully displayed all the reminders in view all, group wise by using query:
SELECT * from tableName WHERE grp = 'Family'|'Office' etc...
but I have a requirement: In view monthly I need to display month wise reminders based on row(month) selected in picker view.I have tried the following query:
SELECT * FROM tableName WHERE Date = 'January'
but it is not working but when I give Date = ‘January 17’ it is displaying the reminder, because I have saved a reminder with that date. It cannot be the case because we are not aware of date the user enters exactly. I have gone through several links for the solution. Some came up with a suggestion to save Date as DATETIME,but when I used it, it displayed failed to create table.Now when I deleted the app frm simulator and made it run again,its getting saved.None of the 3 answers below worked,please help me with valuable suggestions,
Can anyone suggest me a query that will do the trick,
Thanks in advance 🙂
I found out the tactic for retrieving data or all rows corresponding to a particular month.
Firstly save the date format as “yyyy-MM-dd HH:mm:ss”
Then retrieve the data of a particular month
For more information here is the link
Cheers 🙂