Link to home
Start Free TrialLog in
Avatar of lewis94
lewis94

asked on

Show if date is greater than Now

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
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lewis94
lewis94

ASKER

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
Avatar of lewis94

ASKER

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
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.
Avatar of lewis94

ASKER

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