First make sure that you store the date in Julian format by using the
julianday function. Then you should be able to get the day of the week
by take modulo 7 of the julian date. You can use the strftime function
to do that -
** strftime( FORMAT, TIMESTRING, MOD, MOD, ...)
**
** Return a string described by FORMAT. Conversions as follows:
**
** %d day of month
** %f ** fractional seconds SS.SSS
** %H hour 00-24
** %j day of year 000-366
** %J ** Julian day number
** %m month 01-12
** %M minute 00-59
** %s seconds since 1970-01-01
** %S seconds 00-59
** %w day of week 0-6 sunday==0
** %W week of year 00-53
** %Y year 0000-9999
** %% %
*/
Mark Wyszomierski wrote:
Hi,
I've made a text field called "timestamp" which has dates in the form:
YYYY-MM-DD HH:MM:SS
I want to test if the day portion is a Tuesday for example - something like:
SELECT * FROM my_table WHERE DAY(timestamp) = TUESDAY
is something like that at all possible? I've looked at the extended
functions here:
http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
but am unsure of how to take advantage of them.
Thank you,
Mark
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------