Hello
I have a table like this:
Customer ID, Order ID, Date.
(It can contain two rows or more with the same customer ID)
So I need a query that will do that:
If customer made more then 2 orders, in July 15 (for example), then write in a new cell "Good" or "Bad".
I succeed to do it with 3 queries. But, I think it possible with 2 queries or even to do it with one query. Does anyone have any idea how to do it?
The way i did it with 3 queries:
First query:"1" (filter for get july orders)
Customer ID
Order Date - criteria (range of July 15).
Second query:"2" (sort by a group per customer and count the orders in that date)
Customer ID - Group by. - query 1
Order Date - count - query 1.
Third query :"3" ( actual check )
Customer ID - query 2
Count - (just for display reasons -- not necessary)
Good or Bad: if query 2 date count is more then 2 so "good" else "bad".
===
I thought to make "if" term in query 2 but it not worked for me.
pleas i need it for homework.
Thank you all!