I just add a sort criterion (see screenshot). Here is SQL query:

SELECT node.title AS node_title, node.nid AS nid
FROM 
{node} node
ORDER BY node_created_hour DESC
LIMIT 10 OFFSET 0

It seems as we forgot about SQLite in views_date_sql_format().

CommentFileSizeAuthor
#5 1296060-sqlite-support.patch1.74 KBdawehner
sort_criterion.png31.92 KBChi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

You are sadly right. As you use sqlite you are probably more an expert in sqlite.
Please assign the issue to yourself if you can work on it.

dawehner’s picture

Title: SQLSTATE[HY000]: General error: 1 no such column: node_created_hour » Add sqlite to the date specific functions

Update title

Chi’s picture

I am not expert in sqlite. After digging in the code of includes/handlers.inc i found a few functions that are needed to be changed:
views_get_timezone(), views_date_sql_format() and views_date_sql_extract().

There is an article (probably in spanish) that may be helpful for you.
http://www.diegotundo.name/blog/archive-view-su-drupal-7-e-sqlite-errore...

Chi’s picture

Status: Needs review » Active
dawehner’s picture

Status: Active » Needs review
FileSize
1.74 KB

That's great! I just use the main part of this code to create a patch. It would be really great if you could test it.

Chi’s picture

What about views_get_timezone() ?

Chi’s picture

Status: Active » Reviewed & tested by the community

I have tested date sorting with granularity, The patch works for me.

Diego Tundo’s picture

I am the author of the article and I'm really happy to help you! Please contact me if you need on twitter.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for testing the patch. Commited to 7.x-3.x

I talked it some sqlite folks and they set there is no function to convert the timezone.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.