locked
Behavior of news list on the home page RRS feed

  • Question

  • User1768040495 posted

    When adding a news article one of the fields is the date and time for the article.  The form states that the article will only be available to the public after this date/time.

     I've just started populating the news/events tables and noticed that this behavior doesn't seem to be working.  The home page displays all of the news items--even those whose date is at some point in the future.

     Any ideas/suggestions/comments?

    Friday, January 12, 2007 1:09 PM

Answers

  • User1768040495 posted

    I found a solution to this problem.  I'm posting it for anyone else who wants to correct the behavior.

    Change the SqlDataSource1 Data source Select Command from:

    SELECT top 5 [id], [itemdate], [title], [description], [photo] FROM [Announcements] order by itemdate desc

    to

    SELECT top 5 [id], [itemdate], [title], [description], [photo] FROM [Announcements] WHERE ([itemdate] > GETDATE()) order by itemdate desc

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 13, 2007 10:14 AM