Morning All

I'm being driven nuts by dates.

I have a 'date_time' collumn currently set to TEXT.  I am simply trying to
get the records from yesterday.  So the following should work:

SELECT date(date_time,'-1 days') as DATE from tmp_dspace_import

as should...

SELECT strftime('%Y-%m-%d',date_time , '-1 days') as DATE from
tmp_dspace_import

...and numerous other variations.  But NO!

If I run it as a stand-alone single statement it works.

If I run it as part of a longer query I get either just 131 rows of just
today's data or a collumn of NULL values.  I have tried changing the
date_time collumn format to INTEGER and REAL, alond with all variations to
the query known to man (well to me anyway) and no change.

Checked my syntax, all commas in the right places, quotes look good.  head
getting sore from banging it on the desk.

I'm on SQLite v3.20 fwiw.  I'm testing it in the SQLiteStudio query browser
first before running in a Powershell reporting script, but this part simply
does not work and its the only part that doesn't.

The date data is in the format: "21/08/2017 16:27:03".  I thought TEXT
stored it in the ISO "YYYY/MM/DD" format?

The plan is to produce a daily report, as well as a weekly and monthly
report.  To do that I need to get these dates working.

Can anyone please help me?  It must be something really simple I'm
missing.  Am I going to have to split it into the component parts and do it
that way?

Matt
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to