I got it thank you
<cfset clientID = 1 />
<cfset firstDate = '#dateformat(now(),'mm')#/01/#year(now())#'/>
<cfset ormService = viewstate.getValue("ormService")/>
<cfset gw = ormService.createGateway("recurringPayments")/>
<cfset query = gw.createQuery() />
<cfset query.join
('recurringPayments','userAccounts','recurringAccounts') />
<!--- Instabtiate a new where object for this query --->
<cfset where = query.getwhere() />
<!--- Instabtiate an additional clause into the where object --->
<cfset where_2 = where.createWhere()/>
<!--- Start building criteria for the compound where clause --->
<cfset where_2.isEqual(OBJECTALIAS="recurringPayments",
fieldAlias="clientid", value="#clientID#")/>
<cfset where_2.isltField(OBJECTALIAS="recurringPayments",
fieldAlias="paymentcount", compareToObjectAlias1='recurringPayments',
compareToFieldAlias1='maxPayments')/>
<cfset where_2.isGte(OBJECTALIAS="recurringPayments",
fieldAlias="endOn", value='#dateformat(now(),'mm/dd/yyyy')#')/>
<cfset where_2.isLte(OBJECTALIAS="recurringPayments",
fieldAlias="startON", value='#dateformat(now(),'mm/dd/yyyy')#')/>
<cfset where_2.isLt(OBJECTALIAS="recurringPayments",
fieldAlias="lastrun", value='#firstDate#')/>
<!--- Combine the two where objects together to form a compound where
clause --->
<cfset where.addWhere(where_2)/>
<!--- Set the compound where clause to use "or" --->
<cfset where.setMode('or')/>
<!--- Instabtiate an additional clause into the where object --->
<cfset where_3 = where.createWhere()/>
<!--- Start building criteria for the second compound where clause --->
<cfset where_3.isEqual(OBJECTALIAS="recurringPayments",
fieldAlias="clientid", value="#clientID#")/>
<cfset where_3.isNull(OBJECTALIAS="recurringPayments",
fieldAlias="lastrun")/>
<cfset where_3.isGte(OBJECTALIAS="recurringPayments",
fieldAlias="endOn", value='#dateformat(now(),'mm/dd/yyyy')#')/>
<cfset where_3.isLte(OBJECTALIAS="recurringPayments",
fieldAlias="startON", value='#dateformat(now(),'mm/dd/yyyy')#')/>
<!--- Combine the three where objects together to form a compound
where clause --->
<cfset where.addWhere(where_3)>
<cfdump var="#gw.getbyquery(query)#">
On Jun 19, 2007, at 3:19 AM, Tom Chiverton wrote:
I'm planning an Advisor that will translate CF queries and Reactor
Records in
results into a (array of) CFC VO - does this seem sensible ?
Would other people be interested in it ? Is there already one ?
--
Tom Chiverton
Helping to augmentatively introduce out-of-the-box m-commerce
on: http://thefalken.livejournal.com
****************************************************
This email is sent for and on behalf of Halliwells LLP.
Halliwells LLP is a limited liability partnership registered in
England and Wales under registered number OC307980 whose registered
office address is at St James's Court Brown Street Manchester M2
2JF. A list of members is available for inspection at the
registered office. Any reference to a partner in relation to
Halliwells LLP means a member of Halliwells LLP. Regulated by the
Law Society.
CONFIDENTIALITY
This email is intended only for the use of the addressee named
above and may be confidential or legally privileged. If you are
not the addressee you must not read it and must not use any
information contained in nor copy it nor inform any person other
than Halliwells LLP or the addressee of its existence or contents.
If you have received this email in error please delete it and
notify Halliwells LLP IT Department on 0870 365 8008.
For more information about Halliwells LLP visit www.halliwells.com.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --