Date Expressions

P

puzzled

I'm working with Access 2000 SP3 and was surprised to find that using
'<=#03/11/2002#' in a query produces different results than '<#04/11/2002#.
Any explanation?

TIA

Stewart
 
C

Cheryl Fischer

Based on the dates that you typed: 03/11/2002 and 04/11/2002, you would get
different results if there are records with dates between 03/12/2002 and
04/10/2002 in your table.

Just a thought - perhaps you meant to type <=03/11/2002 and <03/11/2002.
In that case, the different number of records returned would be due to the
operators you used.

<= means less than or equal to - this would return records *including*
03/11/2002

< means less than - this would return records *excluding 03/11/2002


hth,
 
P

puzzled

The date format is UK English - taken from Control Panel; dates are Nov 3 &
Nov 4;

<=#03/11/02# does not include 30 records dated Nov 3, for some reason?!

S
 
V

Van T. Dinh

Non-zero time component of your Field values???

Are you aware that DateTime Field values are stored similar to Double where
the integral part represents no. of days since 31/Dec/1899 and the
fractional part represents time since midnight as a fraction of a day, e.g.
0.25 is 6:00 am, 0.5 is noon?

Your criteria will be taken as midnight of 03 Nov 2002. Records with date
03 Nov 2002 and non-zero time component, even 00:00:01 will be bigger than
your specified criteria and therefore will not be selected.

I pointed this out in the second part of my previous post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top