Reply
Comparing Date field
Old 04-21-2006, 03:36 PM Comparing Date field
barbara's Avatar
Skilled Talker

Posts: 77
i want to pull all orders from the database that is less than the Date the Order Entry entered.

DateSubmit -- is the date in the database as a Date field
Date -- is the date enter by the Order entry

rs.Open "Select * from tblTestOrder, tblCustomers where CustomerID = CustID AND DateSubmit = '" &Date& "'", conn

right now, it pulls all order with or without "DateSubmit= '"&Date& "'".
When i take out the quotation around DATE; i got an 0x80040E10 error.

please help
barbara is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-21-2006, 04:27 PM Re: Comparing Date field
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,830
Location: Blackpool. UK
What's the database? if it is Access it may need "#" delimiters around the date

date in ASP will return the current system date so the query in your example will be getting records where the entry date is equal to the current date

somewhere in there you need to be using a JOIN statement as the way the query is set is very inefficient

do you need all fields from both tables?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-24-2006, 02:58 PM Re: Comparing Date field
barbara's Avatar
Skilled Talker

Posts: 77
thanks.
barbara is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Comparing Date field
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.10890 seconds with 12 queries