Results 1 to 3 of 3
  1. #1
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265

    Another unexpected parameter query

    I am posting a new thread because this is a new problem, but the end result is the same as my previous thread. Notice the filter in the WHERE clause where I have require that two calculated fields <>0. With this filter in place, I am prompted to enter a value for HoursPaid, a calculated field.




    But if I remove this filter my query runs fine.


    SELECT qryUnanet.[Person Employee Type Name], qryUnanet.[Person Company], qryUnanet.[Person Exostar Billing Account No], qryUnanet.[Person First Name], qryUnanet.[Person Last Name], qryUnanet.[Timesheet Cell Task QB Project Name], qryUnanet.[Timesheet Cell Task QuickBooks Service Item], qryUnanet.[VIP No], qryUnanet.[Lockheed Week Ending], qryUnanet.UnanetHours, qryUnanet.[Person Billing Rate], qryUnanet.UnanetBillable, IIf(IsNull([PaidHours]),0,[PaidHours]) AS HoursPaid, qryLockheedPaid.[Exostar Billing Rate], IIf(IsNull([PaidAmount]),0,[PaidAmount]) AS AmountPaid, [UnanetHours]-[HoursPaid] AS HoursBalance, [UnanetBillable]-[AmountPaid] AS AmtBalance
    FROM qryUnanet LEFT JOIN qryLockheedPaid ON (qryUnanet.[VIP No] = qryLockheedPaid.[VIP Charge]) AND (qryUnanet.[Lockheed Week Ending] = qryLockheedPaid.[Lockheed WE]) AND (qryUnanet.[Person Exostar Billing Account No] = qryLockheedPaid.[Billing Acct])
    WHERE ((([UnanetHours]-[HoursPaid])<>0) AND (([UnanetBillable]-[AmountPaid])<>0));

  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,930
    I think you have to repeat the HoursPaid calculation in the WHERE clause.
    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
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I don't see where you're pulling in [PaidHours] from any source (such as qryUnanet) so I guess it's asking you for the alias instead of qryUnanet.PaidHours.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Unexpected datatype
    By George in forum Access
    Replies: 6
    Last Post: 03-23-2015, 08:00 PM
  2. Unexpected results with DAO recordset
    By GraeagleBill in forum Programming
    Replies: 1
    Last Post: 10-07-2012, 07:37 PM
  3. Replies: 3
    Last Post: 12-26-2011, 10:45 AM
  4. Unexpected Results from Curdir?
    By bginhb in forum Programming
    Replies: 6
    Last Post: 08-17-2011, 03:58 PM
  5. Query showing unexpected results
    By johnmerlino in forum Queries
    Replies: 30
    Last Post: 10-25-2010, 07:08 AM

Tags for this Thread

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