|
Thanks Vik, I will try that code and see if it works, after reading
through it quickly the first time it would seem to make sense to me.
I would also like to thank you for your summation of the recent MXDU.
I could not possibly attend because I am a single lone designer, and
that amount of money (yes I know it was cheap in relation to going to
the States etc.) would feed my family for 3 months :-)
However I read your entire spin on it and don't think you were Spin
Doctoring it, I believe you simply stated it the way it was and in that
respect as non-goer, I would like to thank you because I know have a
sense of what I missed.
Ron...
-------Original Message-------
Date: Saturday, February 22, 2003 11:08:14 PM
Subject: [cfaussie] Re: Logic help
Hi Ron,
I've seen you have solved the problem, but I've figured a way to optimise your query (ie not having to retreive everything every time):
Set two variables, form.first_athlete_name and form.last_athlete_name. They should be in the format "smith john"
Then you'd use this sql for pulling the next 20:
<cfquery name="BODYBUILDING" datasource="#db_datasource#" username="#db_username#" maxrows="20"> select * FROM athlete WHERE athlete_sport = 'BODY BUILDING' AND athlete_surname + ' ' + athlete_firstname > <cfqueryparam name="#form.last_athlete_name# cfsqltype="cf_sql_varchar"> order by athlete_surname ASC </cfquery>
And this one for the previous 20:
<cfquery name="BODYBUILDING" datasource="#db_datasource#" username="#db_username#" maxrows="20"> select * FROM athlete WHERE athlete_sport = 'BODY BUILDING' AND athlete_surname + ' ' + athlete_firstname < <cfqueryparam name="#form.first_athlete_name# cfsqltype="cf_sql_varchar"> order by athlete_surname ASC </cfquery>
I haven't tested this one but once you fix up the syntax it should work (unless I've overlooked something)... well, it's worth a try anyway. The only bug in it is if you have two athletes with identical first *and* last name, and they happen to be the n*20th and n*20 + 1th record then one of them will be skipped (I think).
Hope you still find this code useful...
Cheers, Vik
Ron Ziemiecki wrote: > You are a legend Phil, thanks, its working perfectly now, go make > yourself a coffee and stretch your legs :-) > > Ron... > > startat will either need to be a session variable, or passed as a URL > parameter. > e.g. > <cflock...> > <cfset session.startat = 1> > </cflock> > ... >
|