Entity select "Today's Records"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Entity select "Today's Records"

James McGill-5
How about an example of an Entity Condition query to find rows based on a
timestamp field "Since midnight today", using Groovy?

--
James McGill
Phoenix AZ
Reply | Threaded
Open this post in threaded view
|

Re: Entity select "Today's Records"

Scott Gray-2
Here you go:

conditionList = [];
dayStart = UtilDateTime.getDayStart(UtilDateTime.nowTimestamp(),  
timeZone, locale);
conditionList.add(EntityCondition.makeCondition("orderDate",  
EntityOperator.GREATER_THAN, dayStart));
// Some other conditions go here
entityCondition = EntityCondition.makeCondition(conditionList);
todaysOrders = delegator.findList("OrderHeader", entityCondition,  
null, ["-orderDate"], null, false);

disclaimer: I didn't test it

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 4/11/2009, at 3:31 PM, James McGill wrote:

> How about an example of an Entity Condition query to find rows based  
> on a
> timestamp field "Since midnight today", using Groovy?
>
> --
> James McGill
> Phoenix AZ


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Entity select "Today's Records"

James McGill-5
Extremely helpful Scott, thank you so much.

On Tue, Nov 3, 2009 at 8:49 PM, Scott Gray <[hidden email]>wrote:

> Here you go:
>
> conditionList = [];
> dayStart = UtilDateTime.getDayStart(UtilDateTime.nowTimestamp(), timeZone,
> locale);
> conditionList.add(EntityCondition.makeCondition("orderDate",
> EntityOperator.GREATER_THAN, dayStart));
> // Some other conditions go here
> entityCondition = EntityCondition.makeCondition(conditionList);
> todaysOrders = delegator.findList("OrderHeader", entityCondition, null,
> ["-orderDate"], null, false);
>
> disclaimer: I didn't test it
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
>
> On 4/11/2009, at 3:31 PM, James McGill wrote:
>
>  How about an example of an Entity Condition query to find rows based on a
>> timestamp field "Since midnight today", using Groovy?
>>
>> --
>> James McGill
>> Phoenix AZ
>>
>
>


--
James McGill
Able Engineering
2920 E. Chambers St.
Phoenix AZ 85040
602-304-1227 x1239
520-256-4370 24/7