Results 1 to 3 of 3
  1. #1
    BrockWade is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    63

    Using Query to find numbers that end in "0.00"

    I'm trying to write a query that only shows numbers that end in "0.00" e.g. 360.00, 100.00, 150.00, 60.00, etc.
    I'm using this simple query:



    SELECT qryUnmatched.Store, qryUnmatched.Amount
    FROM qryUnmatched;

    I was thinkin g too about using "trim":

    SELECT qryUnmatched.Store, qryUnmatched.Amount
    FROM qryUnmatched
    WHERE (((Right(Trim([qryUnmatched].[Amount]),3))=CStr("0.00")));

    I know my syntax is probably wrong here

    but I need to add WHERE clause possibly using the MOD function to find those numbers... any clues? Thanks!!!

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    You have a couple of options, and I'm not sure which one is the most efficient. I suspect the second one is.
    Code:
    WHERE Right(Format([qryUnmatched].[Amount],"0.00"),4)="0.00")
    The format gives you at least three numeric digits plus the decimal point, so the comparison should work correctly.

    Code:
    WHERE ( ([qryUnmatched].[Amount]) = 10*INT(([qryUnmatched].[Amount])/10) )
    The 10*INT(X/10) leaves zeroes in the ones place and the decimals, so it will only equal X if those digits were previously zero.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Amount is a double number field? Access does not save the point and zeros when the decimal is zero.
    So Amount has been converted to a text string with Format function?

    Trim not needed.
    WHERE Right([Amount]),3)=".00"

    There are other possible manipulations but that one seems to accomplish.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-05-2013, 03:46 PM
  2. Replies: 1
    Last Post: 09-19-2013, 11:42 AM
  3. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  4. Replies: 1
    Last Post: 08-23-2012, 08:32 AM
  5. Replies: 4
    Last Post: 08-17-2012, 05:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums