Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 9th, 2004, 10:55 AM
Friend of Wrox
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sql Statement help

I can't figure out how to do this.

SQLStr="SELECT TOP 10 * FROM ORArticles WHERE Featured= 0 ORDER by MagID DESC"
Set RS=Server.CreateObject("ADODB.Recordset")
RS.Open SQLStr,Application("DBConn"),adOpenKeyset,adLockPe ssimistic,adCmdText

This is my current statement, which works fine. I have one featured article that stays ontop or the day with a picture. But the next day when a new featured article comes in the one from the day before is knocked off the list.

What I want to to is, keep the featured article from the day before in the top 10 list. But I also need to make sure I don't choose the featured article from today, that's why I have featured= 0. So is there a way to use the date and say from yesterday or today's date -1 or something like that, or do I just need another sql satament that choose the featured article from the day before?

I hope this is explained right.


\"Don\'t follow someone who\'s not going anywhere\" John Mason

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with SQL Statement forumsUID SQL Server 2000 1 August 23rd, 2007 08:08 AM
convert a SQL Statement from MS Access to a SQL Corey Access 6 March 28th, 2007 12:33 PM
SQL Statement??? carswelljr SQL Server 2000 2 August 25th, 2006 12:40 PM
SQL Statement rylemer SQL Language 3 October 21st, 2005 09:07 PM
sql statement chrisangus@btinternet.com Beginning VB 6 2 June 23rd, 2003 04:28 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.