Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates and unrestrained data

Status
Not open for further replies.

teash

IS-IT--Management
May 3, 2005
99
US
Hello everyone,

SELECT * FROM Orders WHERE (OrderDue>#8/8/2006#);

This SQL statement should give me a list of all the orders that are due in the next few weeks but not the ones that were handled yesterday or in the weeks before.

I inheritied this aweful but functional ASP/Access ordering system. My "OrderDue" column contains all types of data.

For Example:

4/13/06
4-21-06
CANCELED
4/14/06
4/13/06
6-1-06
PENDING
06/12/06
4/7/06
4/12/06
PENDING
4/12/06


My question is, am I wasting my time trying to finding the proper SQL syntax or will I get an error or invalid data.
The SQL function above works, it gives me 300 or so results out of the 2000 records. However all 300 results are not greater than #8/8/06#.

My other option is to query all the data into an array and let the ASP do the work to filter the proper dates. But I think this would be cumbersome.






 
You could modify the SQL to process only those records that have a valid date
Code:
SELECT * 

FROM Orders 

WHERE IsDate(OrderDue) AND (cDate(OrderDue)>#8/8/2006#);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top