android
SQL lite select for actual week (from monday till sunday)
I'm trying to select values for actual week from monday to sunday in SQLlite. I'm trying to do by this way: SELECT * FROM planned_calls WHERE DATE(date) >= DATE('now', 'weekday 0', '-7 days'); But it return also result from past (for example today is monday but in returned result are results from last sunday too). How can I do it right please? Thanks for any advice.
date('now', 'weekday 0') is the next Sunday. Subtracting seven days goes to the previous Sunday. If you want to start at Monday, you have to subtract six days.
Try this : SELECT * FROM planned_calls WHERE DATE(date) > DATE('now', 'weekday 0', '-7 days');
Related Links
SlidingMenu shows blsck when used with Map api v2
Cannot find method using android:onclick
How to set a TextView at the bottom of the screen
Alarm Does Not Wake up my Service
trying to run emulator on eclipse
Android development, retrieving values from a string array
How are .java files in android_stubs_current_intermediates directory generated?
InputStream.Read(byte) returning ioexception : operation canceled
Error on stream media on android
SVG not displaying properly on Android 4.x native browser
SharedPreferences not storing correctly
Refreshing ArrayAdapter onResume [notifyDataSetChanged() not working]
Customizing youtube player view in android
Android Expansion apk
Custom adapter list view is not getting refreshed
post publish updated version of application in android market [closed]