Solved

Show if date is greater than Now

Posted on 2004-04-27
5
485 Views
Last Modified: 2006-11-17
I am fairly new to ASP but have used this site and books to get a better understanding. However I want to show a range of dates for up and coming events but the date must be Today and onwards for 10 days. My date field are stored as Date_id, Event = Event_id and Location = Location_id. I use sql to call in the scripts. This may seem a stupidly basic question but I've tried so much I've given up.

Thanks
0
Comment
Question by:lewis94
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 10927093
Hi lewis94,

Select * From MyTable Where DateDiff(day,GetDate(),Date_ID) <=10

For MSSQL

Or

Select * From MyTable Where DateDiff(day,Now(),Date_ID) <=10

For Access

Tim Cottee
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 

Author Comment

by:lewis94
ID: 10927148
Thanks for the quick response. It makes sense but I just got so tired of trying that I somehow managed to get into a tizzy and gave up.

Thanks again

Lewis94
0
 

Author Comment

by:lewis94
ID: 10928695
I tried the script for the access database but keep getting an error. The SQL I use is as follows

<% sqlString = "Select * From fixtures Where DateDiff(date,now(),Date) <=10"
SET RS = oConn.Execute(sqlString)
WHILE NOT RS.EOF
%>

A colleague says it is because I use the RS method which is not suitable. Is this correct and if so how can I change it or is there a good book you could recommend?

Puzzled?????

Lewis94
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 10928752
lewis94,

With access it is:

DateDiff("d",now(),[Date])

It requires a slightly different syntax. My error as it was some ridiculous time in the morning for me when I posted that response.

Tim.
0
 

Author Comment

by:lewis94
ID: 10971084
Just in case any one else wanted to know the answer, after playing around ith the script I used the following;

SELECT * FROM FIXTURES WHERE [DATE] BETWEEN Date() AND Date()+10 ORDER BY [DATE] DESC

Thanks for all your help
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question