Re: next and previous records
You're not passing your variables. On 5/20/05, WebStop Internet Services wrote: > Help! This keeps failing after the first 25 records are displayed and it > shows all records in the database 25 at a time not just the ones queried > originally by say company_name. Anyone know why? > > > > > > > datasource="LOADDATA"> > SELECT > company_name, > container_no, > billdate,LOADDATA.ID, > SUM(("IN" - out) * rate) AS total_rate, > SUM("IN" - out) AS OnHand > FROM > rate_calc > WHERE BILLDATE > '#DateFormat(todayDate, > "mm/dd/yy")#' > WHERE BILLDATE < '#DateFormat(todayDate, > "mm/dd/yy")#' > WHERE BILLDATE = '#DateFormat(todayDate, > "mm/dd/yy")#' > WHERE COMPANY_NAME = > '#company_name#' > WHERE CONTAINER_NO = > '#container_no#' > > GROUP BY > company_name, > container_no, > billdate, LOADDATA.ID > ORDER BY company_name, CONTAINER_NO, BILLDATE > > ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207600 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: next and previous records
Your problem is your query. Every time this page is called it is calling the query every time. So you need to either push the query into session var, and pull the records out 25 at a time or re write the query to pull 25 records out at a time. Both have their pitfalls, session if any new records are added to the database then you have a problem of not showing these until the session times out. With the other method if a record is added, it will either the records down looking like its duplicating data. Anyway hope this helps. -Original Message- From: WebStop Internet Services [mailto:[EMAIL PROTECTED] Sent: Friday, 20 May 2005 5:47 PM To: CF-Talk Subject: next and previous records Help! This keeps failing after the first 25 records are displayed and it shows all records in the database 25 at a time not just the ones queried originally by say company_name. Anyone know why? SELECT company_name, container_no, billdate,LOADDATA.ID, SUM(("IN" - out) * rate) AS total_rate, SUM("IN" - out) AS OnHand FROM rate_calc WHERE BILLDATE > '#DateFormat(todayDate, "mm/dd/yy")#' WHERE BILLDATE < '#DateFormat(todayDate, "mm/dd/yy")#' WHERE BILLDATE = '#DateFormat(todayDate, "mm/dd/yy")#' WHERE COMPANY_NAME = '#company_name#' WHERE CONTAINER_NO = '#container_no#' GROUP BY company_name, container_no, billdate, LOADDATA.ID ORDER BY company_name, CONTAINER_NO, BILLDATE Untitled Document <!-- INPUT, TEXTAREA, SELECT {font-family: Tahoma; font-size: x-small;} .cfmmaker {font-family: Tahoma; font-size: x-small;} .ewTableOrderIndicator {font-family: Webdings;} --> Displaying records #StartRow# - #ToRow# from the #getCompanyData.RecordCount# total records in your query. Company Name Container Number Total Billable Bill Date On Hand #COMPANY_NAME# #CONTAINER_NO# #DollarFormat(total_rate)# #Billdate# #OnHand# Previous #DisplayRows# Records Previous Records | Next #Evaluate((GETCOMPANYDATA.RecordCount - Next)+1)# #DisplayRows# Records Next Records Back ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207264 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
next and previous records
Help! This keeps failing after the first 25 records are displayed and it shows all records in the database 25 at a time not just the ones queried originally by say company_name. Anyone know why? SELECT company_name, container_no, billdate,LOADDATA.ID, SUM(("IN" - out) * rate) AS total_rate, SUM("IN" - out) AS OnHand FROM rate_calc WHERE BILLDATE > '#DateFormat(todayDate, "mm/dd/yy")#' WHERE BILLDATE < '#DateFormat(todayDate, "mm/dd/yy")#' WHERE BILLDATE = '#DateFormat(todayDate, "mm/dd/yy")#' WHERE COMPANY_NAME = '#company_name#' WHERE CONTAINER_NO = '#container_no#' GROUP BY company_name, container_no, billdate, LOADDATA.ID ORDER BY company_name, CONTAINER_NO, BILLDATE Untitled Document Displaying records #StartRow# - #ToRow# from the #getCompanyData.RecordCount# total records in your query. Company Name Container Number Total Billable Bill Date On Hand #COMPANY_NAME# #CONTAINER_NO# #DollarFormat(total_rate)# #Billdate# #OnHand# Previous #DisplayRows# Records Previous Records | Next #Evaluate((GETCOMPANYDATA.RecordCount - Next)+1)# #DisplayRows# Records Next Records Back ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207241 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Next and previous records
Hi, Yes that is what the solution was based on. Ergo the "thanks Joseph" part. Thank you again for the link. It saved me a good bit of time. Mike >-Original Message- >From: Joseph Thompson [mailto:[EMAIL PROTECTED]] >Sent: Monday, August 20, 2001 2:17 PM >To: CF-Talk >Subject: Re: Next and previous records > > >If this was based on the next x script here (I think it may have been) then >the "cacheing" was simply missed in the copy paste. > >http://cfhub.com/discussion/viewmessages.cfm?Forum=11&Topic=422 > >Simply add the cache to the query: >cachedwithin="#CreateTimeSpan(0,0,10,0)#" > >Note that that will make a "new" cache for every URL.ID that is >requested so >likely the user will have to load that query at least the first time... > >> > > Thanks >> > > >> > > This is what I wound up going with. Seems to be working fine so far. >> > > >> > > ...thanks, Joseph. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Next and previous records
If this was based on the next x script here (I think it may have been) then the "cacheing" was simply missed in the copy paste. http://cfhub.com/discussion/viewmessages.cfm?Forum=11&Topic=422 Simply add the cache to the query: cachedwithin="#CreateTimeSpan(0,0,10,0)#" Note that that will make a "new" cache for every URL.ID that is requested so likely the user will have to load that query at least the first time... > Does anyone have a good query cache idea that would work with the example > included? > > Thanks, > Brandon > > - Original Message - > From: "Don Vawter" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Monday, August 20, 2001 9:19 AM > Subject: Re: Next and previous records > > > > Just a couple of notes: > > 1. Why not use a cached query so it doesn't reexecute on each page > > 2. Be careful using a url parameter (url.id) in a query without first > > validating it. You are leaving yourself open to hackers > > (http://www.vawter.com/urlhack.cfm) > > > > - Original Message ----- > > From: "Michael Wilson" <[EMAIL PROTECTED]> > > To: "CF-Talk" <[EMAIL PROTECTED]> > > Sent: Monday, August 20, 2001 7:59 AM > > Subject: RE: Next and previous records > > > > > > > Thanks > > > > > > This is what I wound up going with. Seems to be working fine so far. > > > > > > ...thanks, Joseph. > > > > > > > > > > > > SELECT portfolio.*, media.*, clients.Client, portfolio.Description AS > > > PortDesc > > > FROM portfolio, media, clients > > > WHERE portfolio.TypeID = #URL.ID# > > > And portfolio.ID = media.PortfolioID > > > AND portfolio.ClientID = clients.ID > > > AND portfolio.ActiveStatus = 1 > > > AND media.ActiveStatus = 1 > > > ORDER BY clients.Client > > > > > > > > > !---Assign default value for "start"---> > > > > > > > > > !---Assign default value for "display"---> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #title# > > > > > > > > > > > > > > > > > > > > > Results Page > > > > > > > > > #PortDesc# > > > > > > > > > > > > > > > > > > > > > > > > previous > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > next > > > > > > > > > > > > > > > > > > > > > > > > > > > >-Original Message- > > > This one also takes "keyword" as a paramater... It may be closer to what > > you > > > need. (even supports multiple columns) > > > > > > http://cfhub.com/discussion/viewmessages.cfm?Forum=11&Topic=422 > > > > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Next and previous records
Does anyone have a good query cache idea that would work with the example included? Thanks, Brandon - Original Message - From: "Don Vawter" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, August 20, 2001 9:19 AM Subject: Re: Next and previous records > Just a couple of notes: > 1. Why not use a cached query so it doesn't reexecute on each page > 2. Be careful using a url parameter (url.id) in a query without first > validating it. You are leaving yourself open to hackers > (http://www.vawter.com/urlhack.cfm) > > - Original Message - > From: "Michael Wilson" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Monday, August 20, 2001 7:59 AM > Subject: RE: Next and previous records > > > > Thanks > > > > This is what I wound up going with. Seems to be working fine so far. > > > > ...thanks, Joseph. > > > > > > > > SELECT portfolio.*, media.*, clients.Client, portfolio.Description AS > > PortDesc > > FROM portfolio, media, clients > > WHERE portfolio.TypeID = #URL.ID# > > And portfolio.ID = media.PortfolioID > > AND portfolio.ClientID = clients.ID > > AND portfolio.ActiveStatus = 1 > > AND media.ActiveStatus = 1 > > ORDER BY clients.Client > > > > > > !---Assign default value for "start"---> > > > > > > !---Assign default value for "display"---> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #title# > > > > > > > > > > > > > > Results Page > > > > > > #PortDesc# > > > > > > > > > > > > > > > > previous > > > > > > > > > > > > > > > > > > > > > > > > next > > > > > > > > > > > > > > > > > > >-Original Message- > > This one also takes "keyword" as a paramater... It may be closer to what > you > > need. (even supports multiple columns) > > > > http://cfhub.com/discussion/viewmessages.cfm?Forum=11&Topic=422 > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Next and previous records
Just a couple of notes: 1. Why not use a cached query so it doesn't reexecute on each page 2. Be careful using a url parameter (url.id) in a query without first validating it. You are leaving yourself open to hackers (http://www.vawter.com/urlhack.cfm) - Original Message - From: "Michael Wilson" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, August 20, 2001 7:59 AM Subject: RE: Next and previous records > Thanks > > This is what I wound up going with. Seems to be working fine so far. > > ...thanks, Joseph. > > > > SELECT portfolio.*, media.*, clients.Client, portfolio.Description AS > PortDesc > FROM portfolio, media, clients > WHERE portfolio.TypeID = #URL.ID# > And portfolio.ID = media.PortfolioID > AND portfolio.ClientID = clients.ID > AND portfolio.ActiveStatus = 1 > AND media.ActiveStatus = 1 > ORDER BY clients.Client > > > !---Assign default value for "start"---> > > > !---Assign default value for "display"---> > > > > > > > > > > > > > > > #title# > > > > > > > Results Page > > > #PortDesc# > > > > > > > > previous > > > > > > > > > > > > next > > > > > > > > > >-Original Message- > This one also takes "keyword" as a paramater... It may be closer to what you > need. (even supports multiple columns) > > http://cfhub.com/discussion/viewmessages.cfm?Forum=11&Topic=422 > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Next and previous records
Thanks This is what I wound up going with. Seems to be working fine so far. ...thanks, Joseph. SELECT portfolio.*, media.*, clients.Client, portfolio.Description AS PortDesc FROMportfolio, media, clients WHERE portfolio.TypeID = #URL.ID# And portfolio.ID = media.PortfolioID AND portfolio.ClientID = clients.ID AND portfolio.ActiveStatus = 1 AND media.ActiveStatus = 1 ORDER BYclients.Client !---Assign default value for "start"---> !---Assign default value for "display"---> #title# Results Page #PortDesc# previous next >-Original Message- This one also takes "keyword" as a paramater... It may be closer to what you need. (even supports multiple columns) http://cfhub.com/discussion/viewmessages.cfm?Forum=11&Topic=422 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Next and previous records
one thing I can suggest is make use of the maxrecords option in the tag. and then in the query say portfolio.TypeID> then page number etc etc. I hope U understand. just in case U have sorting stuff also then this kinda thing gets a bit complicated. --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. -- Phoenix Global Solutions (India) Pvt Ltd., www.pgsolutions.com - "Michael Wilson" To: CF-Talk <[EMAIL PROTECTED]> Subject: Next and previous records 08/20/01 10:53 AM Please respond to cf-talk Hi, I am working on a project that requires "next example" and "previous example" navigation for a portfolio section. On the initial portfolio page the user is presented with a list of "project types" to choose from... development, logo design, photography and etc. Once the user makes a choice, I pop up a new window and proceed to output the data for the first record. Right now I have MAXROWS set to 1 so I can get the display's look down, otherwise I get every record. Eventually I would like to allow them to move through the various examples (records) in that category type in sequence using the same window and page. I have looked at some of the next and previous record tutorials, but most of them deal with presenting X number of records in groups... like next 5, last 5. Given that my query looks for a URL.ID to determine what category to get the records from; is there a way to give the user next and last options using the same window and page.cfm? the query in my pop-up cfm is: SELECT portfolio.*, media.*, clients.*, portfolio.Description AS PortDesc FROM portfolio, media, clients WHERE portfolio.TypeID = #URL.ID# And portfolio.ID = media.PortfolioID AND portfolio.ClientID = clients.ID AND portfolio.ActiveStatus = 1 AND media.ActiveStatus = 1 ORDER BYclients.Client You can see what I am working on, since I probably did a crap job of explaining myself, at: http://ax.servehttp.com/clients/xion/portfolio.cfm Any help is greatly appreciated, Mike ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Next and previous records
Try something like this (this template is called "users_list.cfm"): NOTE: pass the #URL# to this template and the use code here error trapping SELECT DISTINCT UserID, UserName, UserFirstName, UserMiddleName, UserLastName, UserEmailAddress, UserLevel FROM Users ORDER BY UserLastName ASC #NumUsers# #start# through #iif(val(start + maxrows - 1) GT UserList.recordcount,DE(UserList.recordcount),DE(val(start + maxrows - 1)))# of #UserList.recordcount# Surname, First MiddleUser NameEmail AddressAccess Level #UserLastName#, #UserFirstName# #UserMiddleName##UserName#mailto:#UserEmailAddress#"; onmouseover="self.status='Send user an email message.';return true" onmouseout="self.status='';return true">#UserEmailAddress##UserLevel# Peter Tilbrook ColdFusion Applications Developer Australia New Zealand Food Authority Boeing House 55 Blackall Street BARTON ACT 2600 Ph: +61-2-6271 2256 Fax: +61-2-6271 2278 http://www.anzfa.gov.au -Original Message- From: Michael Wilson [mailto:[EMAIL PROTECTED]] Sent: Monday, 20 August 2001 15:24 To: CF-Talk Subject: Next and previous records Hi, I am working on a project that requires "next example" and "previous example" navigation for a portfolio section. On the initial portfolio page the user is presented with a list of "project types" to choose from... development, logo design, photography and etc. Once the user makes a choice, I pop up a new window and proceed to output the data for the first record. Right now I have MAXROWS set to 1 so I can get the display's look down, otherwise I get every record. Eventually I would like to allow them to move through the various examples (records) in that category type in sequence using the same window and page. I have looked at some of the next and previous record tutorials, but most of them deal with presenting X number of records in groups... like next 5, last 5. Given that my query looks for a URL.ID to determine what category to get the records from; is there a way to give the user next and last options using the same window and page.cfm? the query in my pop-up cfm is: SELECT portfolio.*, media.*, clients.*, portfolio.Description AS PortDesc FROMportfolio, media, clients WHERE portfolio.TypeID = #URL.ID# And portfolio.ID = media.PortfolioID AND portfolio.ClientID = clients.ID AND portfolio.ActiveStatus = 1 AND media.ActiveStatus = 1 ORDER BYclients.Client You can see what I am working on, since I probably did a crap job of explaining myself, at: http://ax.servehttp.com/clients/xion/portfolio.cfm Any help is greatly appreciated, Mike ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Next and previous records
Hi, I am working on a project that requires "next example" and "previous example" navigation for a portfolio section. On the initial portfolio page the user is presented with a list of "project types" to choose from... development, logo design, photography and etc. Once the user makes a choice, I pop up a new window and proceed to output the data for the first record. Right now I have MAXROWS set to 1 so I can get the display's look down, otherwise I get every record. Eventually I would like to allow them to move through the various examples (records) in that category type in sequence using the same window and page. I have looked at some of the next and previous record tutorials, but most of them deal with presenting X number of records in groups... like next 5, last 5. Given that my query looks for a URL.ID to determine what category to get the records from; is there a way to give the user next and last options using the same window and page.cfm? the query in my pop-up cfm is: SELECT portfolio.*, media.*, clients.*, portfolio.Description AS PortDesc FROMportfolio, media, clients WHERE portfolio.TypeID = #URL.ID# And portfolio.ID = media.PortfolioID AND portfolio.ClientID = clients.ID AND portfolio.ActiveStatus = 1 AND media.ActiveStatus = 1 ORDER BYclients.Client You can see what I am working on, since I probably did a crap job of explaining myself, at: http://ax.servehttp.com/clients/xion/portfolio.cfm Any help is greatly appreciated, Mike ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists