Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfloop startrow and endrow questions

Status
Not open for further replies.

kuolung

Programmer
Sep 2, 1999
51
0
0
US
I would like to send out 10 emails at the time select from table with N results.

Is there an easy way to do with cfloop startrow and endrow dynamically, say when it completes first 10 records, it starts next 10, and so on or until it reaches recordcount?

thanks so much in advance for any helps.
 
prolly something like :

<cfset recordsPerEmail = 100>
<cfparam name="StartRow" type="numeric" default="1">

<cfset totalRows = yourQuery.RecordCount>

<cfset endRow = MIN(StartRow + recordsPerEmail - 1, totalRows)>

then ...

<cfloop query="yourQuery" startrow="#StartRow#" endRow="#endrow#">

hope it helps...

 
FALCONSEYE, Much appreciated for your prompt response! I'll give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top