跳到主内容

搜索

搜索

Query Prompt Database Connection With Sql Expression

评论

5 条评论

  • Avatar
    Legacy Poster

    Hi Rohan, can you attach a sample of your database preferably in Excel Format. Where Sheet1 = T0 Sheet2 =T1 and Sheet3=T3?

    0
  • Avatar
    Legacy Poster

    G'day sai.htet
     
    Table is attached with one of our internal companies as the customer. The WHERE clause fields in T0 and T2 enables selection of the delivery address for that particular order. we have many customers with multiple delivery locations hence the WHERE clause to link the correct address details.
     
    So my record selection criteria is via T0.[DocNum], which is the sales order number. This is then the prompt when printing.
     

    The forum wouldnt give me permission to upload the xlsx file, so here is the dropbox link:

     

    https://www.dropbox.com/s/4xlfry0h2had7cf/Order%20tables.xlsx?dl=0

     

    I appreciate your help.
     
    Rohan

    0
  • Avatar
    Legacy Poster
    SELECT * FROM `'T0 (sales order table)$'` , `'T1 (customer table)$'` , `'T2 (cust del address table)$'` WHERE `'T0 (sales order table)$'`.`T0#(CardCode)` = `'T1 (customer table)$'`.`T1#(CardCode)` AND `'T0 (sales order table)$'`.`T0#(ShipToCode)` = `'T2 (cust del address table)$'`.`T2#(Address)1` AND (`'T0 (sales order table)$'`.`T0#(DocNum)` = ?QueryPrompt1)
    

    Hi Rohan,

     

    I was able to get it to work using the Joins and Query tabs in BTW, please see the SQL statement that BTW generates.

    So the user enters the DocNum and BTW finds the corresponding records...

    Try removing the single quote around your QueryPrompt1

    0
  • Avatar
    Legacy Poster

    Check this out. Oh to attach files Choose -> More Reply Options bottom right

    0
  • Avatar
    Legacy Poster

    Sorry for being late to respond, but that worked sai.htet. Thank you for your help.

    0

请先登录再写评论。