Quoth YAN HONG YE <yanhong...@mpsa.com>, on 2012-11-09 05:45:06 +0000:
> why use supplierDate,date('now'),strftime(supplierDate) the result is not 
> same result format?
> the one is 2012-11-09
> another is 12/01/2012
> ?
> and how to get the subtraction of two column?

SQLite calendar functions handles textual dates in ISO 8601 format,
but you're not asking strftime to extract a date from supplierDate and
format that; you're asking it to use supplierDate as a _format string_
and since it does not contain any % characters it is returned as-is.
The first argument to strftime is a format string, and the actual date
information is supplied as separate arguments.

You seem to be trying to treat SQLite as though it actually has a date
data type, but it doesn't.  There are different _representations_ of
dates and times and durations and so forth, and only some of them will
work in some situations.  Now _please_ try to understand this _before_
throwing another dozen SELECT statements at the list.  Don't just ask
people to give you the magic formula or ask why it doesn't work when
you plug random things together; try to learn the underlying
principles properly.

   ---> Drake Wilson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to