473,412 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Access Date comparison Problem

Hi I am trying to use the following query to get all dates in a particular range please let me know wht I am doing wrong

Expand|Select|Wrap|Line Numbers
  1. SELECT Unique_Sets_Bulk.CustomerNo, Unique_Sets_Bulk.OrderDate, Unique_Sets_Bulk.RouteNo
  2. FROM Unique_Sets_Bulk
  3. WHERE (((CDate([OrderDate]))>="#1/1/2005#" And (CDate([OrderDate]))<="#12/1/2009#"));
  4.  
  5.  
Jan 23 '08 #1
4 2192
Delerna
1,134 Expert 1GB
Nothing obvious stands out
Try putting the CDate(orderDate) into your select fieldlist and see
that it is in the correct format for the comparison to work
Jan 23 '08 #2
missinglinq
3,532 Expert 2GB
WHERE (((CDate([OrderDate]))>="#1/1/2005#" And (CDate([OrderDate]))<="#12/1/2009#"));

I think you need to lose the quotation marks around the dates, they're turning your dates into strings. Date literals are delimited by the pound sign alone.

Linq ;0)>
Jan 23 '08 #3
ADezii
8,834 Expert 8TB
Hi I am trying to use the following query to get all dates in a particular range please let me know wht I am doing wrong

Expand|Select|Wrap|Line Numbers
  1. SELECT Unique_Sets_Bulk.CustomerNo, Unique_Sets_Bulk.OrderDate, Unique_Sets_Bulk.RouteNo
  2. FROM Unique_Sets_Bulk
  3. WHERE (((CDate([OrderDate]))>="#1/1/2005#" And (CDate([OrderDate]))<="#12/1/2009#"));
  4.  
  5.  
Expand|Select|Wrap|Line Numbers
  1. SELECT Unique_Sets_Bulk.CustomerNo, Unique_Sets_Bulk.OrderDate, Unique_Sets_Bulk.RouteNo, CDate([OrderDate]) AS Converted_Date
  2. FROM Unique_Sets_Bulk
  3. WHERE CDate([OrderDate])>=#1/1/2005# And CDate([OrderDate])<=#12/1/2009#;
Jan 23 '08 #4
Yup It works ... thanx a lot
Jan 23 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Daniel Fisher | last post by:
Hi All! I'm fairly new to PhP and basicly trying to learn right now. Now I have a problem - I have a fairly large collection of movies which people keep borrowing from me. And then not returning....
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
1
by: sylvian stone | last post by:
Hi, I've used standard date functions in the past, but need to create something a little different, as I am working on an investment calculator. What I need to do is validate two dates, and...
5
by: Salad | last post by:
I wrote a routine for somebody yesterday. When I compare datStart to datEnd in the DoWhile comamnd, when the date/times match they don't. For example, 1:00:00 PM does not match 1:00:00 PM. I...
4
by: bhbgroup | last post by:
I have a query on one large table. I only add one condition, i.e. a date (the SQL reads like 'where date > parameterdate'. This query is rather quick if 'parameterdate' is either explicitly...
4
by: JMCN | last post by:
object invalid or no longer set - confusion of the recordset in access 2003. i am currently converting from access 97 to access 2003. majority of the codes converted over perfectly fine, though...
3
by: Karl Gibbon | last post by:
Hi There, I currently have a database in Access 2002 with several forms. I would like to restrict access to one form in perticular until November 1st every year. My current method (attempted...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed...
6
by: MarkAurit | last post by:
Im having difficulty coming up with a good algorithm to express the following comparison: "if <a given date> falls between the (current date - 5 days) and the (current date)" Obviously....
2
by: mikkaro04 | last post by:
hi.. i have a problem about date comparison in VB 6.0 and MS Access i want to compare dates from access to a date from DTpicker control in VB 6.0.. this is my code but it doesnt work coz i get a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.