A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Search for non whole numbers



 
 
Thread Tools Display Modes
  #1  
Old July 6th, 2009, 07:15 PM posted to microsoft.public.access
RickD
external usenet poster
 
Posts: 24
Default Search for non whole numbers

I have a table of data that contains a numeric field. I want to search for
all non whole numbers in that field and create a new table from the results.
  #2  
Old July 6th, 2009, 07:37 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Search for non whole numbers

If by whole numbers, integers would do, put something like this in the
criteria of the field in a query:

CInt([TheFieldName])

However putting similar data in different tables is often a very bad idea.
Would you explain more about what you are trying to do? There might be a
better way.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"RickD" wrote:

I have a table of data that contains a numeric field. I want to search for
all non whole numbers in that field and create a new table from the results.

  #3  
Old July 6th, 2009, 07:45 PM posted to microsoft.public.access
RickD
external usenet poster
 
Posts: 24
Default Search for non whole numbers



I use ACCESS to verify a lot of information in various tables I export from
a FoxPro database program we use to manage our data. In this particular
table, our office should not be entering anything but integers into a
specific field. They do anyway sometimes and I need to isolate these so they
can correct them. There about 125,000 records total in this table.
  #4  
Old July 6th, 2009, 07:50 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Search for non whole numbers

I'd recommend identifying these records in a query instead of creating a new
table especially if you have to go back and fix them. Does the table have a
primary key field so that you can identify the problem records?

It's been a long time since I've done any FoxPro work; however, there should
be a way to prevent bad data like you are finding from being entered.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"RickD" wrote:



I use ACCESS to verify a lot of information in various tables I export from
a FoxPro database program we use to manage our data. In this particular
table, our office should not be entering anything but integers into a
specific field. They do anyway sometimes and I need to isolate these so they
can correct them. There about 125,000 records total in this table.

  #5  
Old July 6th, 2009, 09:53 PM posted to microsoft.public.access
RickD
external usenet poster
 
Posts: 24
Default Search for non whole numbers



Yes, there is a key to id the records, no problem. As far as controlling
the data entry, the field needs to be able to handle decimals, it's just that
we don't want to use them at this time and can't for a while(long story
that has no bearing). Now I just need to find them. I can look at the table
and see them, I would like to query them an print them so I can have them
fixed ion the FoxPro side.
  #6  
Old July 6th, 2009, 10:29 PM posted to microsoft.public.access
Steve[_72_]
external usenet poster
 
Posts: 190
Default Search for non whole numbers

As Jerry suggested, you can create a query that only returns the non-integer
records. Then rather than saving the non-integer data to a table you merely
need to create a report thatuses the query for a recordsource and you
printout the report to get the non-integer data.

Steve



"RickD" wrote in message
...



Yes, there is a key to id the records, no problem. As far as controlling
the data entry, the field needs to be able to handle decimals, it's just
that
we don't want to use them at this time and can't for a while(long story
that has no bearing). Now I just need to find them. I can look at the
table
and see them, I would like to query them an print them so I can have them
fixed ion the FoxPro side.



  #7  
Old July 7th, 2009, 02:53 PM posted to microsoft.public.access
RickD
external usenet poster
 
Posts: 24
Default Search for non whole numbers



When I try this suggestion, I get an error: 'Data type mismatch in criteria
expression' in the query.
  #8  
Old July 7th, 2009, 05:08 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Search for non whole numbers

CInt can have a problem if the numbers aren't between -32,768 to 32,767. CDbl
can handle larger numbers. CInt and CDbl both have problems with Null values.

Also the Int and Fix functions will work on numbers and nulls. Something
like this with the proper field name.

Int([GRC_SWL_Y1Q2])

However the 'Data type mismatch' can happen if there are any alphabetical or
other non-numerical characters in that field in any of the records. In other
words it's best for it to be a number data type in the table. You may need to
check the data for being numbers using the IsNumeric function first. If you
find anything that is not a number, besides a null, the Int or Fix functions
will not work.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"RickD" wrote:

When I try this suggestion, I get an error: 'Data type mismatch in criteria
expression' in the query.

  #9  
Old July 7th, 2009, 09:23 PM posted to microsoft.public.access
RickD
external usenet poster
 
Posts: 24
Default Search for non whole numbers



Thanks Gentlemen. it didn't like using but I tried 'NOT' and that worked.

Thank you.
 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.