Dynamic output by calendar date?

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Dynamic output by calendar date?

    Hi all,

    Here's my latest dilemma. I'm creating a website for a church, and one of the
    features they're requesting is a weekly sermon schedule. I've build the SQL DB
    with the appropriate information for the next 6 months worth of data, however
    if possible I'd like to get that data populated automatically to a CF Template
    for the specific week of the sermon, so that manual updates aren't required.

    I know I can create columns for the week or date of the sermon, however I'm
    not sure what vehicle will call the correct entry for the specific week , and I
    can't seem to find any information on the web to help =\

    This isnt' a request to mooch free code... I just need help understanding the
    logic that would create a function like this, if its even possible, as I'm
    still pretty new with CFML and am cramming much of it in on an as-needed basis
    for this project =)

    Any help is appreciated!

    KidKodiak Guest

  2. Similar Questions and Discussions

    1. calendar date entry
      im looking for an extension that will display a calendar on my page. I want the user to be able to choose multiple dates. The idea is persons can...
    2. Need Calendar - Date Picker
      I need to have my web site users choose a date for ordering materials. I would like to use a calendar like those that hotels/motels have for...
    3. Help looping over data, output grid for a calendar
      I'm trying to build a calendar and want to output days of the week 1-31...few questions...are there date functions to get days of the week, names,...
    4. Initialize Date for Calendar component
      In Flash MX (not 2004) I would like the Calendar component to jump to a year set by the user in an Input field rather than use the forward or...
    5. DB2 Date and Holiday Calendar functions.
      People, Has anyone had occasion to implement holiday functionality into a DB2 calendar of sorts ? I'm looking for suggested ways of implementing...
  3. #2

    Default Re: Dynamic output by calendar date?

    If I'm understanding you correctly, you want your CF page to display the next
    sermon, based on the current date. So if today were 6/24/2005 and the next
    sermon was scheduled for 06/26/2005, you would like to display the sermon for
    06/26/2005.

    You could create a CFQUERY and pass the current date as parameter. Then use
    CFOUTPUT as usual to display the results. This is just an example and the
    exact syntax depends on on how your data is stored, but it should give you a
    starting point.



    <!--- Assumes SermonDate is a date/time field that contains a date only --->
    <cfset todaysDate = Now()>
    <cfquery name="getSermons" datasource="yourDSN">
    SELECT SermonID, SermonDate, Topic, Description
    FROM Sermon
    WHERE SermonDate = (
    SELECT MIN(SermonDate)
    FROM Sermon
    WHERE SermonDate >= #CreateODBCDate(todaysDate)#
    )
    </cfquery>

    mxstu Guest

  4. #3

    Default Re: Dynamic output by calendar date?

    Hi! Yes, that's the right idea, and I'll look at your code and try to figure out what I need to do, thank you for taking the time to reply! =)
    KidKodiak Guest

  5. #4

    Default Re: Dynamic output by calendar date?

    You're welcome. Querying "date" fields can be a bit tricky at first, so feel free to post back if you have any questions and I'm sure somebody can help.
    mxstu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139