Microsoft Access Criteria Query Returns Zero Data

Hi Spiceworks Community!I have a brain-wrecking issue with a query in Access. Would definitely appreciate of any help or input.Situation:
The company I am working for operates heavily on Access Databases. Most of the databases use ODBC connection to pull tables from the database servers for users to print reports and update the tables. The company recently just have a big system migration where we moved all the data to a different database server. Some important tables also got rewritten. However, the old tables are still being kept as Views.Problem:
I'm trying to fix a SELECT query where it pulls up information from two different databases. One called iERP (4 tables from here) and the other one is Qd (1 table from here). Now, the query is fixed and run just fine from Microsoft SQL Server 2014. Even if I run it in Microsoft Access, it...
This topic first appeared in the Spiceworks Community

Hello Nehal -
Try adding a UNION ALL to your parameter dataset query like
UNION ALL SELECT NULL AS EmployeeID , ..
Just check accordingly. I ll revert again based on this , got a priority now.
Happy to help! Thanks. Regards and good Wishes, Deepak. http://deepaksqlmsbusinessintelligence.blogspot.com/

Similar Messages

  • Using external parameters within MS Query returning that data right into a pivot table Excel 2010

    In Excel 2010 i was able to use the external parameters within MS Query returning that data right into a pivot table.  But the parameter on the worksheet will not save in the paremeter setting of the data connection.  And if you save it and open
    it and try to refresh the pivot table Excel stops responding and you have to force the file closed.  I found out the reason to crash is that it did not keep the parameter saved.
    Can this be fixed?

    Hi,
    Just
    checking in to see if the information of Oskar was helpful. Please
    let us know if you would like further assistance.
    Jaynet Zhang
    TechNet Community Support

  • Data driven subscription query returns no data

    We have a data driven subscription on SSRS 2008 R2. The columns in the query are tied to one or more parameters of the report. When we run the subscription and if the query does not return any rows, I was hoping that the subscription will not start; however,
    instead, to my surprise, I got error stating..."Parameter XYZ value can't be null". How to avoid this error and keep subscription from running in this situation? 
    Example: I have a report that required employeeID as a parameter. I have a query (step 3: data driven subscription) that fetches employee ID based on some criteria. If there is no row returned by the query; It throws error on report stating "Parameter
    EmployeeID can't be null."
    Nehal Jain

    Hello Nehal -
    Try adding a UNION ALL to your parameter dataset query like
    UNION ALL SELECT NULL AS EmployeeID , ..
    Just check accordingly. I ll revert again based on this , got a priority now.
    Happy to help! Thanks. Regards and good Wishes, Deepak. http://deepaksqlmsbusinessintelligence.blogspot.com/

  • Query returns zero records in coldfusion context, but works fine in Navicat

    I've got a query that's returning zero records when I load a page.  If I copy and paste that same query (from the debug output) into navicat, I get rows returned (as I expect).  Has anyone seen this?  It happens locally (CF9) AND remotely on our staging server (CF10).  Even weirder, it's a query that was previously working fine - I simply added an if statement to the where clause, and all of a sudden... 
    Here's the query:
            <CFQUERY name="LOCAL.getEncounterServices" datasource="#REQUEST.dsn#"> 
            SELECT
                a.EncounterProductID,
                a.DateTime AS ServiceDate,
                aa.CartItemID,
                aaa.CartID,
                aaaaa.CartStatus,
                b.ProductID,
                b.ProductName,
                b.CPTCode,
                b.Price,
                c.EncounterID,
                c.DateTimeClosed AS EncounterClosedDate,
                d.FirstName,
                d.LastName
            FROM
                EncounterProducts a
                    LEFT JOIN CartItemProduct aa ON (a.EncounterProductID = aa.EncounterProductID AND aa.Active = 1)
                    LEFT JOIN CartItem aaa ON (aa.CartItemID = aaa.CartItemID)
                    LEFT JOIN Cart aaaa ON (aaa.CartID = aaaa.CartID)
                    LEFT JOIN CartStatus aaaaa ON (aaaa.CartStatusID = aaaaa.CartStatusID),
                Product b,
                Encounters c,
                Contacts d,
                EncounterStatuses e
            WHERE
                1 = 1
                AND (aa.CartItemID IS NULL OR aaaaa.CartStatus = 'Deleted')
                AND a.Active = 1
                AND a.ProductID = b.ProductID
                AND a.EncounterID = c.EncounterID
                AND c.PatientID = d.ContactID
                AND c.EncounterStatusID = e.EncounterStatusID
                AND e.EncounterStatus = 'Closed'
              <CFIF IsDefined("ARGUMENTS.encounter") AND IsObject(ARGUMENTS.encounter)>
                     AND c.EncounterID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.encounter.getID()#">
             <CFELSE>
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
               </CFIF>
                AND c.LocationID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.locationID#">
                AND c.CustomerID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.customerID#">
            </CFQUERY>
    All of this worked just fine before I added the lines:
             <CFIF IsDefined("ARGUMENTS.encounter") AND IsObject(ARGUMENTS.encounter)>
                     AND c.EncounterID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.encounter.getID()#">
             <CFELSE>
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
              </CFIF>
    Previously, it had just been:
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
    With no IF/ELSE statement.
    Anyone seen anything like this before?  Any ideas? 
    Thanks.

    Right, I'll start disabusing myself of the DateFormat!
    I'm sorry, I should've posted the actual query too.  It's inserting the first part - "AND c.EncounterID = ....."
    Here's the full query:
    LOCAL.getEncounterServices (Datasource=xmddevdb, Time=9ms, Records=0) in /Applications/ColdFusion9/wwwroot/XMD_NEW/xmd_dev/cfc/ShoppingGateway.cfc @ 16:56:28.028
    SELECT
                a.EncounterProductID,
                a.DateTime AS ServiceDate,
                aa.CartItemID,
                aaa.CartID,
                aaaaa.CartStatus,
                b.ProductID,
                b.ProductName,
                b.CPTCode,
                b.Price,
                c.EncounterID,
                c.DateTimeClosed AS EncounterClosedDate,
                d.FirstName,
                d.LastName
            FROM
                EncounterProducts a
                    LEFT JOIN CartItemProduct aa ON (a.EncounterProductID = aa.EncounterProductID AND aa.Active = 1)
                    LEFT JOIN CartItem aaa ON (aa.CartItemID = aaa.CartItemID)
                    LEFT JOIN Cart aaaa ON (aaa.CartID = aaaa.CartID)
                    LEFT JOIN CartStatus aaaaa ON (aaaa.CartStatusID = aaaaa.CartStatusID),
                Product b,
                Encounters c,
                Contacts d,
                EncounterStatuses e
            WHERE
                1 = 1
                AND (aa.CartItemID IS NULL OR aaaaa.CartStatus = 'Deleted')
                AND a.Active = 1
                AND a.ProductID = b.ProductID
                AND a.EncounterID = c.EncounterID
                AND c.PatientID = d.ContactID
                AND c.EncounterStatusID = e.EncounterStatusID
                AND e.EncounterStatus = 'Closed'
                     AND c.EncounterID = ?
                AND c.LocationID = ?
                AND c.CustomerID = ?
    Query Parameter Value(s) -
    Parameter #1(cf_sql_integer) = 28
    Parameter #2(cf_sql_integer) = 16
    Parameter #3(cf_sql_integer) = 6
    Thansk again for the help!

  • Non-technical user needs help with Microsoft Access/MS-Query connection

    I've read through some of the other threads on problems with the ODBC connection from MS Access to an Oracle database but as a non-techie I'm afraid I need to ask based on the steps I have always used. I'm not totally inexperienced as I have gone through the same steps on multiple Windows XP machine running different versions of Oracle and Office over the past 10 years but the steps aren't working this time. If there are settings that need to be checked or changed (path, etc.) I'm afraid I'll need specific instructions as to where I need to look for them.
    I'm currently trying to set up a connection on a new laptop running a 64-bit version of Windows 2007 Professional.
    1) I've installed a full 64 bit Oracle 11g client and 32 bit copy of Microsoft Office Professional Plus 2013.
    2) I set up the Oracle data source using the client Net Manager. I can connect from there.
    3) I added it in the Oracle-provided Microsoft ODBC Administrator and can connect from there.
    I the past, after doing this, the was automatically included in the list of ODBC Databases in MS Acess but this time it's not. I tried adding it as a new data source by selecting the Microsoft ODBC for Oracle driver but receive the same  "The Oracle(tm) client and networking components were not found" error message that has plagued so many others.

    This is bad code, for lots of reasons:
    (1) Scriptlet code like this should not be used. Learn JSTL and use its <sql> tags if you must.
    (2) This code belongs in a Java object that you can test outside of a JSP. JSPs are for display only. Let server-side objects do the database work for you.
    (3) You don't close any ResultSet, Statement, or Connection that I can see. Microsoft Access doesn't save any records until you close the Connection.
    (4) You don't have any transactional logic. When you write to a database, you usually want it to be a unit of work that is committed or rolled back together.
    %

  • Report Query returning "No Data Found" with bind variables

    I put a simple query into Report Query:
    Select "bluefish". "name" as "name",
    "bluefish"."primary_flag" as "primary_flag",
    "bluefish"."status" as "status",
    "bluefish"."ID" as "ID" from "bluefish" "bluefish" where "bluefish"."ID" = :P3_XPRINTID
    When I test the query, data is returned; however, when I try to run the query using "Test Report" button, I get an error 01403 No Data Found. If I replace the bind variable with an explicit value, the report works.
    Anyone have any ideas as to what is causing this problem? I am using the Generic Report Layout, with various output types. I AM editting the query and defining the bind variable before I test the report (otherwise, the query wouldn't run).
    Charles

    Sometimes if you create a form/report/whatever using the wizards, it will create an After Submit process called something like Reset Page - basically you want to make sure you don't have any After Submit processes that call a Clear Session state (it may say something like Clear Cache for Page).
    In your branch, there is also a box that says Clear Cache - you want to make sure that does not have page Number 8 in it or it will clear your session state.
    Put the page in Debug mode and read through it - check to make sure your value is getting saved and maybe you can see what is going wrong.

  • Upload data from microsoft access to oracle form(in data block)

    Hi all,
    Any one can help me, how we can upload data from access file to developer form(in data block).
    as
    we upload data from text file to developer form(in data block) using some packages.
    Thank's in advance

    Hi Zuhair,
    If you give details of the problems you are still having then we should be able to get SQL*Developer to work.
    However, if you don't want to use SQL*Developer then the following options are taken from note 393760.1 available in Metalink if you have access to that -
    1. Use a gateway that supports the non-Oracle database or generic connectivity if a third party ODBC driver is available to do a -
    'create Oracle_table as select from non_oracle_table@database_link'
    for each table. You would then have to manually create all the other objects (views, indexes, stored procedurs etc) and permissions etc that existed in the non-Oracle database.
    2. Use the SQL*Plus COPY command to copy data from the non-Oracle database to the
    Oracle database using a gateway or generic connectivity. The syntax is as follows:
    COPY FROM username/password@oracle_sid -
    INSERT destination_oracle_table -
    USING query;
    The following example selects all rows from the EMP table in the non-Oracle database and
    inserts them into the local Oracle EMP table:
    COPY FROM SCOTT/TIGER@ora10 -
    INSERT EMP -
    USING SELECT * FROM SCOTT.EMP@gateway;
    where "gateway" is the database link created for the gateway.
    3. Load the non-Oracle data into flat files and use SQL*Loader to put the data into Oracle tables. Again manual
    work is required for the other objects.
    4. Contact the Oracle Product Technology Services (PTS) group for assistance. See the webpage -
    http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html
    5. Use a third party migration tool. See -
    http://www.oracle.com/technology/tech/migration/isv/third_party.html
    6. Use JDBC to connect to the non-Oracle database and Java in the Oracle database. This method will work but it is not suppported by the JDBC team.
    =========
    The amount of work involved will depend on the number and size of Access tables that you want to migrate.
    Regards,
    Mike

  • Query returning zero results for yesterdays same hour

    I have the following query:
    SELECT
    d_dtm,
    BTS_ID,
    CASE WHEN D_DTM = (D_DTM-24/24)
    THEN sum(V_ATT_CNT)
    END AS "LASTATT",
    sum(V_ATT_CNT) as "V_ATT_CNT",
    CASE WHEN D_DTM = D_DTM
    THEN sum(V_ATT_CNT)
    END AS "ATT"
    FROM
    DMSN.DS3R_FH_1XRTT_FA_LVL_KPI
    WHERE
    to_date(D_DTM, 'DD/MM/yyyy') >= (SELECT TO_DATE(max(D_DTM),'DD/MM/YYYY') FROM DMSN.DS3R_FH_1XRTT_FA_LVL_KPI)-2
    GROUP BY
    d_dtm,
    BTS_ID
    having
    CASE WHEN D_DTM = (D_DTM-24/24)
    THEN sum(V_ATT_CNT)
    END > 0
    But it is not returning any results because of the "having" clause. I know it should return results because all I want it to do is in one column have the V_ATT for the current time period, and in the 2nd column, have the V_ATT 24 hours ago. I've checked the data and I should get results back but can't seem to figure out why this is not working...
    Edited by: k1ng87 on Apr 22, 2013 1:03 PM

    Hi,
    k1ng87 wrote:
    I have the following query:
    SELECT
    d_dtm,
    BTS_ID,
    CASE WHEN D_DTM = (D_DTM-24/24)
    THEN sum(V_ATT_CNT)
    END AS "LASTATT",
    ...You may have noticed that this site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text (including, but not limited to, code) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    That's just one of many useful things found in the forum FAQ {message:id=9360002}  
    But it is not returning any results because of the "having" clause. You're right:HAVING CASE
         WHEN d_dtm = (d_dtm - 24/24)
         THEN SUM (v_att_cnt)
         END > 0
    Whatever d_dtm is, it's not d_dtm - 24/24, so the WHEN condition will never be TRUE.  That means the CASE expression will always return NULL, and NULL is not greater than 0, so the HAVING condition will never be TRUE.
    k1ng87 wrote:
    confused on what I'm missing here...I'm using version 11g, not sure if that matters for this ? though....There is no version 11f or 11h, so it's kind of silly to say you're using 11g.  Why not give your actual version number, like 11.2.0.2.0?  Sometimes, the part after 11 makes a huge difference.
    But probably not in this case, as you said.   What's more important is for you to post CREATE TABLE and INSERT statements for a little sample data, and the results you want from that sample data.
    No kidding; see the forum FAQ {message:id=9360002}.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • VO Query returning "No Data to Display" on production server

    Hello,
    I have a simple application that displays data taken from an external oracle database.
    I have 2 pages, one displaying a list of house, the second one displaying the details of a house.
    I get that "master / detail" relationship via the executeWithParams.
    Both my Development machine and production server gets their information from the same database, using the same credentials.
    My problem is that on the production server, the details page returns a "no data to display" in the table I use to show the detailed information. On the development machine it runs just fine. The list master page runs just fine on both environment.
    I'm using jdev 11.1.2.3.0.
    The tables I access are not owned by the user I use in my credentials, but I do have GRANT_SELECT on the said tables.
    I've looked at the logs and I do not see any error as to why no data is returned in production.

    You can try giving the table GRANT ALL TO PUBLIC and verify if the table has a Synonym in the data base.

  • BEx Query Returning No Data

    I have loaded the Active Content of an ODS (the /BIC/ZAXXXXXXXX table) directly via an Insert statement in an ABAP program.  I can see the data when I go through SE11 and through the Active Data button inside of the Manage option of the ODS. When I use this ODS via BEx I do not get any data to appear.  Does anyone know why this would be?  Do I need to load a different table, maybe the change log, instead of the Active content?  It has now turned into more of a curiosity question of why an ODS with Active Data, but no Requests, would show no results in BEx.  Any help would be appreciated.
    Jon

    Hi,
    maybe loading records straight into the active table doesn't give BW a signal that the data is refreshed. The result from your query are most likely to come from cache ? Try to change the selection of the query or run the query without using the cache.
    regards,
    Raymond Baggen
    Uphantis bv

  • Why does Oracle SQL query returning a date field without the time component

    Hi,
    I'm a novice SQL user & hv just installed Oracle SQL developer (Version 3.0.04, Build MAIN-04.34).
    I made the same SQL query using "Oracle SQL developer" & "TOAD for Oracle 9.0.1" but I got 2 different format on the same date field:
    On TOAD, I get the date field extracted as *04/26/2011 23:12:58*
    On Oracle, I get the date field extracted as *26/APR/11*
    Why is the Oracle result in a different format & missing the time component?
    Is there any option/preference that I need to set in Oracle SQL developer to get the full date/time format displayed?
    I've tried to set my the date format to DD/MON/RR HH12:MI:SSXFF AM under the preference -> database NLS but I still get the same format!
    Plse help!

    hokim wrote:
    Hi,
    I'm a novice SQL user & hv just installed Oracle SQL developer (Version 3.0.04, Build MAIN-04.34).
    I made the same SQL query using "Oracle SQL developer" & "TOAD for Oracle 9.0.1" but I got 2 different format on the same date field:
    On TOAD, I get the date field extracted as *04/26/2011 23:12:58*
    On Oracle, I get the date field extracted as *26/APR/11*
    Why is the Oracle result in a different format & missing the time component?
    Is there any option/preference that I need to set in Oracle SQL developer to get the full date/time format displayed?
    I've tried to set my the date format to DD/MON/RR HH12:MI:SSXFF AM under the preference -> database NLS but I still get the same format!
    Plse help!http://edstevensdba.wordpress.com/category/nls_date_format/

  • Infoset Query Returns Wrong Data

    Hi there exports,
    I created a infoset query based on 3 DSO's 0PUR_O01 (Purchase Order Items), 0PUR_DS03 (Purchase Order Item Schedule Line) & a Z-DSO (Material Consumption).
    I need information by PO Number (Item, Material) and the total consumption for that material from the Z-DSO irrespective what the item & PO Number is.
    My link to Z-DSO is material & plant. My problem is that the info from the orther 2 DSO is triple when I run my query.
    Any suggestions?
    Thank you
    Dirk

    Hi,
    This issue arrises due to the infoset property, ie. Infoset provides intersection of data.
    So for a single combination of material and plant in Z-DSO, there might be multiple (here 3)records in other two DSO so you get the triple amount in Query.
    Inorder to overcome it you must ideally join the DSO in a infoset based on the same key fields..
    Hope it helps..
    Regards..
    Umesh.

  • Query Return Truncated Data Please Help

    when i insert data into a Table having fields dbnote_no(number),
    narration(varchar2 1000),etc.. the data get inserted properly but when i view it after few days the data in the narration field get truncated to 100 characters if have changed the linsize in login script to 1000 in server and also in globin script.

    You might want to set the buffer width.
    In sqlplus, go to the options/environment menu and specify 1000 for buffer width

  • Can't view Microsoft Access data

    Hello,
    I am trying to use a Microsoft Access database (97) as a data source for my repository. I can import it in the Administration Tool and see all the tables. When I finish my repository the global consistency is without errors.
    Then I go to the Answers and make a table, here I see the repository but when I try to view the results it returns only values from the other data source.
    I am using OBIEE 10.1.3.3.2
    Anyone got a suggestion?
    Rgds,
    Dennis de Kock

    I cannot see data at column level either.
    Perhaps there still is a (logical) problem in your logical model.
    I suggest to quickly create a new business model, just for testing. Drag and drop 1 table from your access source twice to the business model. Create a complex join between table and table#. Put an aggregate on one number field in table#. Drag/drop business model to presentation layer.
    Have a look if you now have data from this table in Answers.
    Regards

  • To put Data type inside a table of Microsoft Access (dummy ask)

    Hi to all,
    I am new to use database in java ... (but I did it long time in Visual Basic) and I have a trivial problem...
    I try this SQL statement in different why without success...
    int clientIdKey = 3;
    Date = regneDate new Date();
    "INSERT INTO myTable (idCli, dateReg) VALUES (" + clientIdKey + ", #" + regneDate + "# )";
    The message error I get in this case is the follow:
    "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression '#Sat Oct 20 16:54:23 PDT 2007#'".
    (I tried to format the value of regneDate in different why too... but it was not good the same...)
    I know the mine is a stupid problem .., but I am not going to get the right road, so I ask to some one that it know the whay to say it me please...
    Thank you very much
    regards
    tonyMrsangelo

    Joe's correct. Do it like this:
    int clientIdKey = 3;
    Date regneDate = new Date();
    String sql = "INSERT INTO myTable (idCli, dateReg) VALUES(?,?)";
    PreparedStatement stmt = null;
    try
        stmt = connection.prepareStatement(sql);
        stmt.setInt(1, clientIdKey);
        stmt.setDate(2, regneDate);
        int numRowsAffected = stmt.executeUpdate();
    catch (SQLException e)
        e.printStackTrace();
    finally
        try { if (stmt != null) stmt.close(); } catch (SQLException e) {}
    }    %

Maybe you are looking for

  • Sale order date determination

    hi friends, kindly explain,how the sale order date is determined. on what criteia it is determined?

  • Function module to create query view from technical name of the query ?

    Hi Experts, I am trying to create webservice definition using function module. In this code, I am calling function module 'RSCRMBW_REPORT' which requires query view name ( we can see this in RSCRM_BAPI) as a value for parameter i_reportuid. For the t

  • I cannot get my HP Photosmart to print.

    So when I bought my mac the other day I got my free printer that comes along with it. It is a HP Photosmart. I am connected wirelessly and my computer and printer have found one another/connected. When I go and try to print a page is allows me to cho

  • Group By Without Using Any Aggregate Function

    L1                                L2 54654               414.00 654654               237.60 654654      54654               1,108.80 654654               1,136.00 654654               5,956.00 NOW I WANT OUTPUT LIKE L1               L2           sum

  • Simple Flip Book in Flash Builder

    I built this simple Flip Book in Flash Builder starting with Flash Catalyst...I guess the big issue is that when I make these components...they work well at z=0, but when I change z things don't work...why? Definitely needs a fix...everything is belo