Results 1 to 4 of 4
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    no value


    I have two tables, the first has daily information such as the date and shift. the second has recorded downtimes. both are joined with a unique ID. what I'm after is to list the dates and if there was downtime then show it, if no downtime entered that day then show a "0". is there a function or statement that will pick the value and if there was no entries for that day give me the date and a 0?

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    ok, here's what my tables have-
    Production Table Downtime Table
    enter shift Production_Date DailyProdID Length
    700 6/1/2015 707 15
    701 6/1/2015 707 30
    702 6/2/2015 700 60
    703 6/3/2015 700 45
    704 6/3/2015
    705 6/4/2015
    706 6/5/2015
    707 6/5/2015
    708 8/6/2015
    715 8/11/2015
    716 8/11/2015
    717 8/11/2015


    what i'm trying to get is-
    Production Table
    enter shift Production_Date Length
    700 6/1/2015 105
    701 6/1/2015 0
    702 6/2/2015 0
    703 6/3/2015 0
    704 6/3/2015 0
    705 6/4/2015 0
    706 6/5/2015 0
    707 6/5/2015 45
    708 8/6/2015 0
    715 8/11/2015 0
    716 8/11/2015 0
    717 8/11/2015 0

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Do an outer join, show all values in the production table and the missing one in tDowntime.
    run another query on that one with NZ to convert the nulls to zero

  4. #4
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    that worked, thanks

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

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