Finding first time company placed an order

Harris@Z

Registered User.
Local time
Today, 22:35
Joined
Oct 28, 2019
Messages
104
I am trying to determine the first time a company [Company_ID] placed an order [Order_Date].
I have tried different ways and they are clumsy and do not give the correct result.

It somehow seems that there should be an easy way to do this but I cannot figure this out (not being an expert programmer)

Can someone advise please?
 
use Total query:

select Company_ID, Min(Order_Date) As FirstDateOfOrder from yourTableName Group By Company_ID;

if you know the Specific Company_ID, then you can use it as Criteria on your query:

select Company_ID, Min(Order_Date) As FirstDateOfOrder from yourTableName Where Company_ID = 1234 Group By Company_ID;
 
Thanks very much!
Works exactly as I needed it to.
 

Users who are viewing this thread

Back
Top Bottom