Results 1 to 4 of 4
  1. #1
    Heatshiver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    128

    Question Query Won't Return Valid Parameter! Possibly Simple Fix.

    I have four tables all related by date. I want to create a simple query that asks for a start date and end date in order to populate a report as such.



    Every time I create a query with the Wizard and include more than one table (or even more than just the "Days" field), my parameter Between [Start Date] And [End Date] won't return any values.

    However, if I use the Query Wizard and put only "Days", my parameter will return values from the table(s). I then have to add all the remaining fields/tables to the query manually...

    Does anyone know what might be going on?

    The only thing I noticed is that if I choose just "Days" with the Query Wizard, it gives the name as [Days] in the query itself. But when I choose other fields/tables, it always appears as a different format and gives me problems.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  3. #3
    Heatshiver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    128
    Here is from the Query where it works (all one table):

    SELECT [All].Days, [All].[Mud Flow Line Temp], [All].[Mud Pit Temp], [All].[Mud In to HE Temp], [All].[Mud Out of HE Temp], [All].[LGS%], [All].[Mud Weight], [All].[Oil Water Ratio]
    FROM [All]
    WHERE ((([All].Days) Between [Start Date] And [End Date]));

    Here is from two tables that won't work:

    SELECT [All].Days AS All_Days, [Centrifuge #1].[LGS lb/hr], [Centrifuge #1].[HGS lbs/hr], [Centrifuge #1].[Hours Run], [Centrifuge #1].[Mt Tons LGS], [Centrifuge #1].[Mt Tons HGS], [Centrifuge #1].[Total Mt Tons], [Centrifuge #1].[Feed PPG], [Centrifuge #1].[Feed GPM], [Centrifuge #1].[Centrate PPG], [Centrifuge #1].[Centrate GPM], [Centrifuge #1].[Solids PPG], [Centrifuge #1].[Solids GPM], [Centrifuge #1].[Mud Discharge], [Centrifuge #1].[NAF Discharge], [Centrifuge #1].[Total Volume Discharge bbl], [Centrifuge #1].[Average OOC%], [Centrifuge #1].[Average Specific Gravity Solids]
    FROM [All] INNER JOIN [Centrifuge #1] ON [All].[Days] = [Centrifuge #1].[Days]
    WHERE ((([All].Days) Between [Start Date] And [End Date]));


    It seems like it has to do with my relationships. They are inner joins to one table...

  4. #4
    Heatshiver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    128
    I think I may have figured it out. Without any data in one of the tables, the entire query will show no data. However, if it at least has some data (even if not for the field chosen), then it will work as expected.


    Why is that?

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

Similar Threads

  1. Newb question (but possibly complex)
    By MavisCruet in forum Database Design
    Replies: 3
    Last Post: 11-29-2011, 07:16 AM
  2. Simple query doesn't return anything
    By lbytesxk in forum Queries
    Replies: 6
    Last Post: 09-15-2011, 06:50 AM
  3. Replies: 3
    Last Post: 08-15-2011, 10:06 AM
  4. Replies: 2
    Last Post: 06-03-2011, 04:36 PM
  5. is this a valid SQL statement ? (simple)
    By markjkubicki in forum Queries
    Replies: 1
    Last Post: 07-22-2010, 06:49 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