I am trying to write a query that would allow me to get a list of companies that were created this month that at least would have one order.
I have two tables dbo.Companies and dbo.Orders They are linked by CompanyID
I have written a partial script but I cannot figure out how to complete it.
SELECT COUNT(*) FROM dbo.Companies WHERE Month(CreatedDateTime) = MONTH(getDate())
That gives me a list of all the companies that have been created this month but I am confused how to get the final part of 'that have at least one order'.