Share via

Convert SQL Server Query to Access Query

Anonymous
2017-08-28T08:45:10+00:00

Hello,

Please Help me to convert below MS SQL Server Query to Access Query

SQL Server Query

select r.*,v.pay_date,v.customer_name,v.pay_amt,v.bal_amt from report_invoice r full outer join ( Select t1.inv_no,t1.inv_date,t1.pname,t1.grand_total , t2.pay_date,t2.customer_name,t2.pay_amt,t2.bal_amt From cte t1 LEFT join payment_customer t2 on t1.inv_date = t2.pay_date and t1.pname = t2.customer_name Where rn=1 UNION ALL Select t2.inv_no,t2.inv_date,t2.pname,t2.grand_total , t1.pay_date,t1.customer_name,t1.pay_amt,t1.bal_amt from payment_customer t1 LEFT join cte t2 on t1.pay_date = t2.inv_date where t2.inv_date is null) v on r.inv_no=v.inv_no

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2017-08-28T18:24:31+00:00

    The SQL you posted is a mishmash and I am sure it would not run on MS SQL Server.  Punctuation is missing.  You have 'v' as an alias but it is never defined unless it should be 'r' (report_invoice) which is defined and not used.

    It actually seems to be several queries with lots missing.  Where did you obtain it?

    Was this answer helpful?

    0 comments No comments