On Tue, Mar 23, 2010 at 2:58 PM, Bernie Reiter <bernie_on_the_road_ag...@yahoo.co.uk> wrote: > Nico, thanks for your quick reply. > > I have copied the function strftime('%Y-%m-%d', ...) directly the sqlite > documentation > and substituted the ... with my date string. > Unfortunately, your advice doesn't seem to convince my Linux box, > neither with a straight single quote nor with a "backwards leaning" single > quote > > [liveu...@localhost ~]$ SELECT strftime('%w','2010-03-21'); > bash: syntax error near unexpected token `(' > > > [liveu...@localhost ~]$ SELECT strftime('%w',`2010-03-21`); > bash: syntax error near unexpected token `(' >
Bernie, you need to take a break and get a cup of coffee ;-) Then, make sure you start sqlite before issuing a sqlite command. As shown above, you are trying to query a db from bash, bash has no clue what to do. > > > > > ----- Original Message ---- > From: Nicolas Williams <nicolas.willi...@sun.com> > To: Bernie Reiter <bernie_on_the_road_ag...@yahoo.co.uk> > Cc: sqlite-users@sqlite.org > Sent: Tue, 23 March, 2010 20:29:28 > Subject: Re: [sqlite] Computing day of week the using strftime() function - > Feature or bug ? > > On Tue, Mar 23, 2010 at 07:25:56PM +0000, Bernie Reiter wrote: >> I am checking this for Sunday, March 21st 2010, Monday, 22nd March 2010 and >> Tuesday, 23nd March 2010: >> >> Sunday, March 21st 2010: SELECT strftime('%w',2010-03-21); => 6 > > You need single quotes around the date value. > > 2010-03-21 == 2010 + -03 + -21 -- surely not what you intended. > > Nico > -- > > > > > -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science ======================================================================= _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users