Results 1 to 5 of 5
  1. #1
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    192

    Date to appear

    Dear Friends
    I am generating a Processing Report, Date Wise of cotton ginned.

    In the Dialog Box Form to generate the Report I have two controls namely First Date and Last Date.
    When I enter the dates and click Preview button the Report generates for the dates between the First Date and Last Date.
    The first column of the report is Date column and the subsequent columns are production details, and the details are returned by using the DSum and DLookup functions.


    Certain dates in between the Dates entered may not have production details. However I want those dates also to appear in the report. I can use Nz function to return zero value.

    So please help me so that the dates of non-production also should appear.
    Thanks

  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
    Investigate LEFT JOIN that will show all records from Left table and only those matching records in right table. More info about your tables and requirements may help readers to better understand your needs.
    see w3schools sql

  3. #3
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    192
    Thanks Orange.
    However the tblProcessing which is the report based on will have only dates for which processing is done. I want the date to appear for which no processing done.
    Regards,
    Alex

  4. #4
    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
    I think you are going to have to identify such dates and let Access know about them- in some manner.
    You could have a table of Dates --all dates in the Time period.
    Perhaps someone has a sample to show.

  5. #5
    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
    Here is a short mock up: StartDate 1 Oct 2015.....EndDate 8 Oct 2015

    Consider 2 tables: tblProduction with ProdDate and Amount

    ProdDateId ProdDate ProdAmt
    1 02/10/2015 100
    2 03/10/2015 250
    3 07/10/2015 300

    and table tblMyDates a list of Dates in the time period

    dateID DateToReport
    1 01/10/2015
    2 02/10/2015
    3 03/10/2015
    4 04/10/2015
    5 05/10/2015
    6 06/10/2015
    7 07/10/2015
    8 08/10/2015

    Then a query with a Left Join

    Code:
    SELECT 
    tblMyDates.DateToReport
    , tblProduction.ProdDate
    , tblProduction.ProdAmt
    FROM tblMyDates LEFT JOIN tblProduction ON 
    tblMyDates.DateToReport = tblProduction.ProdDate;
    With results:

    DateToReport ProdDate ProdAmt
    01/10/2015
    02/10/2015 02/10/2015 100
    03/10/2015 03/10/2015 250
    04/10/2015
    05/10/2015
    06/10/2015
    07/10/2015 07/10/2015 300
    08/10/2015

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

Similar Threads

  1. Replies: 4
    Last Post: 11-20-2018, 11:57 PM
  2. Replies: 4
    Last Post: 02-11-2015, 11:53 AM
  3. Replies: 3
    Last Post: 12-02-2014, 07:58 PM
  4. Replies: 11
    Last Post: 07-20-2014, 06:22 PM
  5. Replies: 3
    Last Post: 08-21-2012, 03:05 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