Results 1 to 3 of 3
  1. #1
    kieranharrison is offline True blue Aussie m8
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Location
    Queensland, Australia
    Posts
    28

    Question A call to all SQL Query wizards!!

    Hi Guys,

    Just wondering if anyone could please help me re-write this query. Currently the query results will show a row only if all of the fields in the query are populated - this is a problem for me because the query is pulling from different tables which might not always be populated.

    Basically, I need the query to show 'null' or something like that if there is no value in the field, rather than not show the entire row at all.

    Hope that makes sense.

    Code:
    SELECT received_files_table.Processing_Month AS ProcessingMonth, received_files_table.IATA_Code AS IATACode, received_files_table.Airline AS Airline, received_files_table.Received_Date AS ReceivedDate, received_files_table.Received_Notes AS ReceivedNotes, uploaded_files_table.IATA_Code AS UploadedIATA, uploaded_files_table.Airline AS UploadedAirline, uploaded_files_table.Uploaded_Date AS UploadedDate, to_publish_table.Published_Month AS PublishedMonth, to_publish_table.IATA_Code AS PublishedIATA, to_publish_table.Published_Date AS PublishedDate
    FROM received_files_table, uploaded_files_table, to_publish_table;
    Thanks very much in advance!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    There is no JOIN clause. This is a cross join or Cartesian relationship. Every record of each table will associate with every record of the other tables. This can result in a very large, very slow dataset. I doubt you will like the result.

    Should to_publish_table have Airline and Notes fields?

    How should these tables be related? Link on the common Processing_Month, IATA_Code, Airline fields?

    Why not have 1 table with another field for category (received, uploaded, published)? Or a field for each category date?
    Last edited by June7; 07-01-2019 at 10:55 AM.
    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
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Here is the original sql from post #1 reformatted for readability

    Code:
    SELECT received_files_table.Processing_Month AS ProcessingMonth
    	,received_files_table.IATA_Code AS IATACode
    	,received_files_table.Airline AS Airline
    	,received_files_table.Received_Date AS ReceivedDate
    	,received_files_table.Received_Notes AS ReceivedNotes
    	,uploaded_files_table.IATA_Code AS UploadedIATA
    	,uploaded_files_table.Airline AS UploadedAirline
    	,uploaded_files_table.Uploaded_Date AS UploadedDate
    	,to_publish_table.Published_Month AS PublishedMonth
    	,to_publish_table.IATA_Code AS PublishedIATA
    	,to_publish_table.Published_Date AS PublishedDate
    FROM received_files_table
    	,uploaded_files_table
    	,to_publish_table
    Further to June's comment, we really need to know the "business" behind this SQL in order to know what is being requested in simple, plain terms.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-27-2018, 08:29 PM
  2. Where are the Wizards when I drop a checkbox?
    By markcrobinson in forum Forms
    Replies: 9
    Last Post: 07-28-2017, 09:36 AM
  3. Wizards are not working in Access 2013
    By JAlmon in forum Access
    Replies: 2
    Last Post: 10-30-2014, 12:18 PM
  4. Command Button Wizards are disappeared
    By maher khan in forum Access
    Replies: 1
    Last Post: 12-08-2013, 02:35 AM
  5. Access Crashes When Wizards are Used
    By DCSwearingen in forum Access
    Replies: 6
    Last Post: 04-12-2009, 07:35 PM

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