423,335 Members | 1,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,335 IT Pros & Developers. It's quick & easy.

Message to show on customers with no orders on Access

P: 4
Hello! I am doing a continuous report based on customers and the orders they have placed. I have to include all customers whether or not they have placed orders. I also have to include a message saying that the customer placed no orders. I've been struggling with this concept. How do I include the message? Thanks!
May 9 '18 #1

✓ answered by NeoPa

You start with a query where your customer table is linked with a LEFT JOIN to your orders table. A LEFT JOIN will mean that all fields from the orders table are represented as Null.

Now comes the easy part. Use Nz() to show either the linked value if it exists, or the message if the value is Null.

Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,004
You start with a query where your customer table is linked with a LEFT JOIN to your orders table. A LEFT JOIN will mean that all fields from the orders table are represented as Null.

Now comes the easy part. Use Nz() to show either the linked value if it exists, or the message if the value is Null.
May 9 '18 #2

P: 4
It worked! Thank you so much!
May 13 '18 #3

NeoPa
Expert Mod 15k+
P: 31,004
It's a pleasure to help where I can :-)
May 13 '18 #4

Post your reply

Sign in to post your reply or Sign up for a free account.