Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Show if date is greater than Now

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

609 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