Yes, but it is one level above native date/time fields.<br><br>All databases have equivalent functions for date math and the like (EXTRACT, INTERVAL, ...etc).<br><br>My point was the need for in-SQL operations for queries, which no matter how you abstract the individual CRUD (we already have user_load() and node_load() for that), you still need in-SQL for reporting and aggreggation.
<br><br><div class="gmail_quote">On Dec 3, 2007 7:40 PM, Larry Garfield <<a href="mailto:larry@garfieldtech.com">larry@garfieldtech.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c"><br>On Mon, 3 Dec 2007 18:42:56 -0500, "Khalid Baheyeldin" <<a href="mailto:kb@2bits.com">kb@2bits.com</a>> wrote:<br>> On Dec 3, 2007 1:49 AM, Larry Garfield <<a href="mailto:larry@garfieldtech.com">
larry@garfieldtech.com</a>> wrote:<br>><br>>><br>>><br>>> As for in-SQL operations on the date value, like MONTH() or YEAR() in<br>>> MySQL?<br>>> If someone has an idea for those that doesn't involve regexing every
<br>> query<br>>> I<br>>> would dearly love to hear it. :-)<br>>><br>><br>> The current use of UNIX timestamp is a compromise, and has its issues, but<br>> still allows in-SQL operations.<br>
><br>> In-SQL operations is very very important. Going to ActiveRecord type of<br>> abstraction without the ability to do aggregate operations on the data is<br>> just not an option.<br>><br>> Without in-SQL, doing things like:
<br>><br>> select n.nid, n.type, n.title, count(*) as num_votes, avg(value) as<br>> avg_vote<br>> from votingapi_vote v inner join node n on content_id = n.nid where n.type<br>> =<br>> 'image' and
n.created between unix_timestamp('2007-11-01 00:00:00') and<br>> unix_timestamp('2007-11-30 23:59:59') group by v.content_id having<br>> num_votes<br>>> 1 order by avg_vote desc, num_votes desc limit 20;
<br>><br>> Would be impossible, or would entail very expensive full table scans.<br><br></div></div>Except that unix_timestamp() is MySQL-specific, isn't it?<br><font color="#888888"><br>--Larry Garfield<br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Khalid M. Baheyeldin<br><a href="http://2bits.com">2bits.com</a><br><a href="http://2bits.com">http://2bits.com</a><br>Drupal optimization, development, customization and consulting.