•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 423,719 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,146 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums
Views: 6934 | Replies: 16
•
•
Join Date: Jul 2005
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
I would like to create a page which will pull news items according to today's date. What I have is a database which users input thier news information. But now I need to have the information output to a page which will change daily according to the current date. The BeginDate fields and EndDate fields are in date format in my database. Here's what I have to work with...
<!---Retrieve news from database--->
<cfquery name="NewsQuery" datasource="News">
SELECT *
FROM News
WHERE BeginDate <= '#Dateformat(Now(), "mm/dd/yyyy")#'
AND EndDate >= '#Dateformat(Now(), "mm/dd/yyyy")#'
</cfquery>
<!---Output news to page--->
<cfoutput query="NewsQuery">
<p>
#NewsTitle#
#NewsDesc#
#NewsDate#
</p>
</cfoutput>
Anything specific you can provide me with is greatly appreciated. Please provide me some code... I've been working on trying to get this to work for weeks!
Thanks for your help!!! :eek: :mrgreen:
<!---Retrieve news from database--->
<cfquery name="NewsQuery" datasource="News">
SELECT *
FROM News
WHERE BeginDate <= '#Dateformat(Now(), "mm/dd/yyyy")#'
AND EndDate >= '#Dateformat(Now(), "mm/dd/yyyy")#'
</cfquery>
<!---Output news to page--->
<cfoutput query="NewsQuery">
<p>
#NewsTitle#
#NewsDesc#
#NewsDate#
</p>
</cfoutput>
Anything specific you can provide me with is greatly appreciated. Please provide me some code... I've been working on trying to get this to work for weeks!
Thanks for your help!!! :eek: :mrgreen:
•
•
•
•
•
•
•
•
DaniWeb ColdFusion Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
advertising apple blogging business community copyright crime development email environment firefox gaming google hacking hardware ibm internet ipod law legal linux malware marketing microsoft mobile mozilla myspace networking news red hat research satnav search security skype social networking software spam storage survey technology trends trojan tv ubuntu virus vista web windows youtube
- Previous Thread: code error
- Next Thread: Help with a search form/page



Threaded Mode