?
Solved

Show if date is greater than Now

Posted on 2004-04-27
5
Medium Priority
?
486 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

770 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