Results 1 to 5 of 5
  1. #1
    smarty84handsome is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    67

    Post Parameters (Date Range) not working

    I have created a query for report which has two parameters i.e. "Date from" and "Date To" which is suppose to help me show the data in a particular date range. The data is pulled from the table when given the desired date range. But somehow this is not working........can someone help me with this ?

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Can you post the SQL code of your query?

  3. #3
    smarty84handsome is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    67
    SELECT [Discrepancy Table].Amount, [Discrepancy Table].[Over/Short], [Discrepancy Table].Explanation, [Discrepancy Table].Type, [Discrepancy Table].Status, [Employee File].Employee_Number, [Employee File].Employee_Name, [Discrepancy Table].[TSSR Date]
    FROM [Employee File] INNER JOIN [Discrepancy Table] ON [Employee File].[Sr No] = [Discrepancy Table].[Emp ID]
    WHERE ((([Employee File].Employee_Number)=[Enter Employee Number]) AND (([Discrepancy Table].[TSSR Date])=[Enter Date From] And ([Discrepancy Table].[TSSR Date])=[Enter Date To]));


    I want 'TSSR Date from' and 'TSSR Date to' to be my parameter when i open report and this is not working.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you are entering different From and To Dates, how can [TSSR Date] be equal to two different dates at the same time?
    It cannot. So your query will never return anything unless you enter the same date for both criteria.

    You need to change it to:
    Code:
     AND (([Discrepancy Table].[TSSR Date])>=[Enter Date From] And ([Discrepancy Table].[TSSR Date])<=[Enter Date To]));
    or use BETWEEN, i.e.
    Code:
    ([Discrepancy Table].[TSSR Date] BETWEEN [Enter Date From] AND [Enter Date To])

  5. #5
    smarty84handsome is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    67
    Great it is working now.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-06-2013, 10:30 AM
  2. Replies: 17
    Last Post: 01-16-2013, 08:22 PM
  3. Replies: 1
    Last Post: 01-16-2013, 10:58 AM
  4. Date range not working
    By victoria61485 in forum Queries
    Replies: 4
    Last Post: 09-08-2011, 08:56 AM
  5. date range form values as parameters
    By cfnieder in forum Forms
    Replies: 8
    Last Post: 08-11-2010, 01:48 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