Results 1 to 6 of 6
  1. #1
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56

    Criteria - Returning more than specified

    I have a query based on a table. The table has many fields. I am only interested in 3. I have pulled those 3 fields in the query.



    query1
    ...ModuleName
    ...Status
    ...DateTime

    When I specify criteria(="export") under the field [ModuleName] in my query I'm not getting records that only contain my criteria. How is this possible? I only want records that contain the word "export".

  2. #2
    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
    That does sound odd.

    Post the full SQL statement of the query.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  3. #3
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    I cannot append the database as it's all linked tables to an SQL server over ODBC so I'm thinking this won't help.

    Here is my full SQL statement:
    SELECT dbo_viewPagesScanned.[ModuleName], dbo_viewPagesScanned.[BatchStatus], dbo_viewPagesScanned.[SessionEndDateTime]
    FROM dbo_viewPagesScanned
    WHERE (((dbo_viewPagesScanned.[ModuleName])="export"));

  4. #4
    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
    Can't see anything wrong with the SQL.

    You could import records from the SQL db and test on the imported data. Are results same?
    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.

  5. #5
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    I just tried a Pass-Through query on that table. Using same SQL(fixing the underscore) it's giving me an ODBC--call failed error.

    [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Export'. (#207)

    I linked the table and the "Design View" "Field Name" is saying "ModuleName". It should be correct... Unless I'm missing something... Could SQL send me altered column names? Or should I say the ODBC SQL connection be altered by Access?

  6. #6
    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
    Sorry, not enough experience with SQL Server db to advise.

    No idea why it thinks 'export' is a field.

    Next test is to import data and see what you get.
    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: 5
    Last Post: 08-02-2012, 09:44 AM
  2. Function - Returning a Value
    By dreamnauta in forum Programming
    Replies: 3
    Last Post: 01-05-2012, 03:37 PM
  3. Query Criteria not returning any records
    By SgtSaunders69 in forum Access
    Replies: 2
    Last Post: 12-19-2011, 07:45 PM
  4. Returning PK after append?
    By MikeMairangi in forum Database Design
    Replies: 5
    Last Post: 08-18-2011, 04:28 PM
  5. Query - Returning ID instead of Value...??
    By Poolio in forum Queries
    Replies: 5
    Last Post: 04-18-2011, 07:10 AM

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