Results 1 to 6 of 6
  1. #1
    j_a_monk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    6

    Left Join not

    I am trying to run a full join on 2 tables saving into a 3rd table joining on 3 fields.

    I have gotten all records to load from Video 2 and gotten only records that have a match to load from Video2 but I have not been able to get matching records to join.

    Is there something I am missing in this?

    Code:
    INSERT INTO HDDandVideo2 (watched, discType, discNum, discLabel, videoPath, hashMD5, fileType, fileSizeMB, title, writeDateTime, videoFormat, width, height, bpp, frames, fps, audioFormat, frequency, bpc, channels, length, category)
    
    SELECT Video2.watched, Video2.discType, Video2.discNum, Video2.discLabel, Video2.path, Video2.title, Video2.fileType, Video2.fileSizeMB, Video2.writeDateTime, Video2.videoFormat, Video2.width, Video2.height, Video2.bpp, Video2.frames, Video2.fps, Video2.audioFormat, Video2.frequency, Video2.bpc, Video2.channels, Video2.length, Video2.hashMD5, Video2.category
    
    FROM Video2 LEFT JOIN HDDandVideo2 
    ON (Video2.fileSizeMB = HDDandVideo2.fileSizeMB) 
    AND (Video2.fileType = HDDandVideo2.fileType) 
    AND (Video2.hashMD5 = HDDandVideo2.hashMD5)
    
    WHERE (((Video2.hashMD5)=[HDDandVideo2].[hashMD5]) AND ((Video2.fileType)=[HDDandVideo2].[fileType]) AND ((Video2.fileSizeMB)=[HDDandVideo2].[fileSizeMB]));
    I have tried Googling but have not found anythign that fits.
    Using Access 2007.

    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,948
    Why would you be joining to the destination table to insert new records? Are you really trying to update existing records? That would be an UPDATE not INSERT sql and the syntax for the sql is very different.
    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
    j_a_monk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    6
    I will be updating the destination table in the future with new records from both source tables.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,948
    Okay but I still don't understand why the destination table is in the nested SELECT query. You say 3 tables are involved but I see only 2 table names.
    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.

  5. #5
    j_a_monk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    6
    Sorry, I have 2 source tables both of which will also be updated in the future with new records, those are Video2 and HDDVideo. The destination table I want to join to is HDDandVideo2.

    If there is a way to import directly into HDDandVideo2 and join on import?

  6. #6
    j_a_monk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    6
    I ended up joining the two source tables, so it is solved for now. I was trying to keep them separate but this is managable.

    Sorry for the confusion, thank you

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

Similar Threads

  1. inner, left or right join ?
    By toqilula in forum Access
    Replies: 0
    Last Post: 04-11-2011, 12:20 AM
  2. Replies: 3
    Last Post: 02-02-2011, 01:00 PM
  3. Left join problem
    By e.badin in forum Queries
    Replies: 5
    Last Post: 01-17-2011, 08:03 AM
  4. Problem with Left Join & VB6
    By msrdjan1 in forum Queries
    Replies: 0
    Last Post: 03-30-2010, 01:48 AM
  5. Update with LEFT JOIN
    By mcarthey in forum Access
    Replies: 1
    Last Post: 08-27-2008, 10:49 AM

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