Hi William,
Sorry about the late reply, only have an Internet connection at school.
Thanks so much this is what I was trying to do`-`
I will have to reformat the database so that they have this format.
I put the dates as ("Saturday , January 13, 1997" for example)
When I go home I will try to remove the day of the week, and just have the date
such as:January 13, 1997.
On more question please?
If I will need the date as 01/13/1997 in the database to get this working, what
is the best way to format the full date on the CF page?
I am thinking that I could use dateFormat()?
<cfset thedate = now()>
<cfoutput>
#DateFormat(TheDate, 'dddd mmmm dd, yyyy')#
</cfoutput>
Now this gets todays date, I will try to figure out how to get the date from
the database, and display it in this format.
Thanks so much for all your help.
John
----- Original Message -----
From: William Seiter <[EMAIL PROTECTED]>
Date: Sunday, December 16, 2007 10:15 pm
Subject: RE: cfquery loop
To: CF-Newbie <[email protected]>
> To get all the articles for a specific timeframe, you will need to
> work with
> the 'where' statement for your date field.
>
> Select article_id, article_title, date_entered from articles where
> date_entered >= "01/01/2007" and date_entered <= "12/31/2007"
>
> Different databases have different methods of dealing with date
> fields (and
> how to filter against them), but above is a simple and basic format.
>
> What you will want to do is use the date formatting that is the
> same as the
> way the date is in your date_entered field. (eg. if your dates
> are stored
> as 12/15/2007, then the 'mm/dd/yyyy' pattern works, if your date is
> "2007-12-15" then you would use the 'yyyy-mm-dd' pattern. However
> it is
> saved in the database, you will want to match the pattern.)
>
> Hope this helps,
> William
>
> --
> William E. Seiter
>
> Have you ever read a book that changed your life?
> Go to: www.winninginthemargins.com
> Enter passkey: goldengrove
>
> Web Developer
> http://William.Seiter.com
> -----Original Message-----
> From: John Barrett [mailto:[EMAIL PROTECTED]
> Sent: Sunday, December 16, 2007 11:05 PM
> To: CF-Newbie
> Subject: cfquery loop
>
> I have a page that gets article data from a database(I think that
> it is
> called a master/detail page). I can with help from this list
> display all the
> articles, but I would like to display the articles by year. That
> is, loop
> through the article_id for each year(such as 1 to 12 for the fist
> year. I
> was think that I could use this, but it still displays all the
> articles.Could somebody please help. When I take out the "SELECT *
> FROM articles" I
> get a "Can not issue empty query." error.
> Thanks so much,
> John:
> <cfquery name="get_articles" datasource="articles">
>
> Select article_id, article_title, date_entered from articles
> </cfquery>
>
> <cfquery name = "get_articles"
>
> dataSource =
> "articles">
> SELECT *
> FROMarticles
> </cfquery>
> <cfloop query =
> "get_articles">
> <cfset Start = 1>
> <cfset End = 12>
>
> </cfloop>
>
> Here is the original code:
> <!--- main Page, to display links--->
> <cfquery name="get_articles" datasource="articles">
> Select article_id, article_title, date_entered from articles
> </cfquery>
>
>
> <cfoutput query="get_articles">
> target="_blank">#article_title#<br>
> #date_entered#<p>
> </cfoutput>
>
> <!--- output page, to display articles--->
> <cfquery name="get_articles" datasource="articles">
> Select article_id, article_title, date_entered from articles
> </cfquery>
>
> <cfquery name="get_article" datasource="articles">
> select article_title, article_text, date_entered from articles
> wherearticle_id = '#article_id#'
> </cfquery>
>
> <cfoutput>#get_article.article_title#</cfoutput></p>
> <cfoutput>#get_article.article_text#</cfoutput></p>
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:3195
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15