Jump to content

Retrieve data based upon multiple conditions


Benchenko

Recommended Posts

Hi,

 

I am trying to show a list of accounts where 2 identical products, have been ordered for the same account, within the same calendar month.

 

Field names:

 

A/c number,

Order id,

Cust name,

Product,

Purchase date

 

I have used GROUP BY and HAVING, but I am concerned with the volume of records returned.

 

Any help, please?

 

Thank you

 

 

Link to comment
Share on other sites

Group by would be correct, you'll need to use a function to return the month and year only of the date, and group by that value plus the account, plus the product. You can use having to filter out anything with only 1 record. What query are you using now?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...