Results 1 to 3 of 3
  1. #1
    adaoluz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    46

    create query from table

    Hello people good night!


    I have a question, I have a database but unfortunately I lost the back


    end, I would like to know if it is possible to create the lost tables from a query?


    below the query's SQL code?




    obs: if anyone has any code for me to create I'm grateful.


    Code:
    SELECT ApontamentoProducao.IdTurno, Produtos.IdProduto, Produtos.ProductName, Productos.AbrevName, Produtos.Arouping, ApontamentoProducao.IdOperacao, Sum (ProducedProducao.QtdProduced) AS QtAcabada
    FROM Products INNER JOIN ApontamentoProducao ON Produtos.IdProduto = ApontamentoProducao.IdProduto
    WHERE (((ApontamentoProducao.Data) Between Forms! RELOPEMAQSELEC! DTINI And Forms! RELOPEMAQSELEC! DTFIM))
    GROUP BY ApontamentoProducao.IdTurno, Produtos.IdProduto, Produtos.ProductName, Products.NameAbrev, Produtos.Aroupamento, ApontamentoProducao.IdOperacao
    HAVING (((Products.ProductName) <> "999") AND ((ProductionProduction.Industry) = "FINISH"));

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    all the query is telling you is the fields that have been used. It does not tell you about the other fields or the field type, indexes etc - and of course what the data was.

    However I cannot see how your query could possibly work - the FROM clause is joining two tables (products and ApontamentoProducao) but with criteria from another one - Produtos, whilst your HAVING clause references another table - ProductionProduction which is not in the FROM clause and you are also summing a field from yet another table ProducedProducao which also isn't in the FROM clause. And just for good measure, fields in your GROUP BY Clause do not match those in the SELECT clause (Products.NameAbrev, Produtos.Aroupamento v Productos.AbrevName, Produtos.Arouping)

  3. #3
    adaoluz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    46
    I understand

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

Similar Threads

  1. create query from both fields in table
    By willfrank in forum Access
    Replies: 2
    Last Post: 04-14-2016, 12:57 PM
  2. How do I get the CREATE TABLE part from a table creation query?
    By Javier Hernández in forum Programming
    Replies: 5
    Last Post: 01-14-2014, 01:56 PM
  3. Create a temporary Table from Query
    By WickidWe in forum Queries
    Replies: 1
    Last Post: 12-11-2013, 07:19 AM
  4. Replies: 2
    Last Post: 12-20-2011, 07:33 AM
  5. Replies: 1
    Last Post: 12-16-2011, 08:16 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