[UPHPU] select records with date

Wade Preston Shearer wadeshearer.lists at me.com
Thu Jan 28 11:12:48 MST 2010


On 28 Jan 2010, at 11:09, Lonnie Olson wrote:

> On Thu, Jan 28, 2010 at 10:21 AM, Wade Preston Shearer
> <wadeshearer.lists at me.com> wrote:
>>> Simple simplification here:
>>>
>>> SELECT * FROM Users u, User_Actions ua
>>> WHERE u.id = ua.user_id
>>> AND ua.date >= NOW() - INTERVAL 3 YEAR;
>>>
>>> This date math syntax is easier to read and understand.  It doesn't
>>> require ADDDATE or anything.  Just a simple + or -
>>
>> This doesn't take into account the sign up date though.
>
> Does it need to?  I guess I don't understand.  According to your first
> post you wanted the records that occurred in the last 3 years, did it
> not?

It did in the original logic. The requirements just changed though. I  
am posting an update. Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3392 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20100128/4b762aec/attachment.bin 


More information about the UPHPU mailing list