Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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 29th, 2004, 01:16 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default Choose all records from 2 weeks ago??

Hello All

I want to take any records in my database that are no older than 2 weeks and display them. I tried this

SQLStr="SELECT * FROM ABNNews WHERE (date = " & (date-14) & ") ORDER by Date DESC"

If you can help me with this that would be great.

Thanks
__________________
-----------------------------------------------------------
\"Don\'t follow someone who\'s not going anywhere\" John Mason
 
Old March 29th, 2004, 04:10 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Look into the DateAdd function.
 
Old March 29th, 2004, 04:28 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay, I will see what I can do

Thanks

 
Old June 2nd, 2004, 05:13 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

Not sure what database you are using, but try this.

MsSql:
SQLStr="SELECT * FROM ABNNews WHERE date >= '" & date()-14 & "' ORDER by Date DESC"

MsAccess:
SQLStr="SELECT * FROM ABNNews WHERE date >= #" & date()-14 & "# ORDER by Date DESC"


 
Old January 9th, 2007, 01:00 PM
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default


DaveGerard should be promoted. The project deadline was building a noose around my neck. Thanks a zillion Dave!


Cheers!
Pramod

"In this life, unless we don't live again"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with weeks Vince_421 Access 5 January 30th, 2007 12:34 PM
weeks yula Crystal Reports 1 August 31st, 2006 11:28 AM
Old post from a year ago, had question plz galacticsoul General .NET 0 August 4th, 2006 12:01 PM
User choose number records to display per page jripke74 Classic ASP Databases 4 July 12th, 2004 11:19 AM
When is two weeks later? Snib Javascript How-To 2 November 28th, 2003 04:40 AM





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