Query with criteria for long data type but criteria is double

G

Guest

When I use a criteria of >=0 and <365.25 on a field that is a long integer it
returns 0 rows. If I change the 365.25 to 366 it returns the correct number
of rows.

This query appears to work correctly on some workstations where I have
Office 2003 installed. It does not consistently work on each workstation -
only some.

I know the resolution is the modify the criteria to be >=0 and <366, but I'm
very curious why MS Access returns zero rows sometimes and then the
appropriate set of rows another time.

Any thoughts? Thanks!
 
A

Allen Browne

Okay, the fact that it works on some machines and not on others means you
are trying to find out what is the difference between the machines.

First place to look might be the Windows Control Panel, under Regional
Options. Is there a difference in the decimal separator or the list
separator? Some locales us a comma or dot to mean different things.

If there's no difference in locale settings, is there a difference in
versions of JET? Using the Windows Explorer, locate msjet40.dll (typically
in windows\system32). Right-click, and choose Properties. On the Version
tab, are they the same? More info on JET versions:
http://support.microsoft.com/kb/239114

Since the field is a Number type of size Long Integer, and the criteria is a
literal (not a parameter or reference to a text box), I doubt that JET could
be confused about the data types.
 

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