Hi Chris, Thanks so much for your help, and you have been so very helpful! Yep, I am very week with SQL, and after this I am going to boarders here to find a simple book on MySQL.
Thanks again for all your help:) John On Dec 20, 2007, at 5:35 AM, Chris Griffin wrote: > Just a note, when thinking about ways to show data, try to get the > data as close as you can to the way you want to see it using the SQL > statement, then do the rest with CF. In a nutshell if you are > unfamiliar with DESC, GROUP, COUNT, or LEFT JOIN you need to find a > simple SQL reference. This will make your life easier. > > Best of luck > > > On Dec 20, 2007, at 2:53 AM, John Barrett wrote: > >> I have a datbase with 382 article. With loys of help from this list >> I was able to get many aspects working, but the one thing that I >> can't figure out is how can I get the latest article, and the >> latest article -1. This I mean last weeks, and 2 weeks ago, the >> last two entries in the db. >> >> I know I could call the article_id by number, such as #382 for the >> last one, and #381 for the second to last one, but I want the app >> to be dynamic. There must be a way to do this, and I would really >> be greatful for any help. >> >> Thanks, >> John >> >> here is how I get the first year: >> <cfquery name="get_articles" datasource="articles"> >> Select article_id, article_title, date_entered from articles >> </cfquery> >> >> <!--- (This gets the first year) >> Select article_id, article_title, date_entered from articles where >> article_id >= "1" and article_id <= "12" ---> >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3214 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
