Hi all, I'm happy using SQL editor to select fields & rename etc, but I've never done any SQL coding, so don't know the syntax.
I have a database of 15m records of sales data. But I only need to pull out the 1st Order & Last Order date for each customer.
The current syntax is here:
Select dbo.dim_data_source.data_source, dbo.dim_Customer.CustomerNumber As [Customer Number], dbo.dim_Moss_Calendar.YYYYMMDD, MOSSDW.dbo.fact_Invoice.ILORD As [Order No.] From MOSSDW.dbo.fact_Invoice Left Join dbo.dim_data_source On dbo.dim_data_source.dim_data_source_key = MOSSDW.dbo.fact_Invoice.dim_data_source_key Left Join dbo.dim_Customer On dbo.dim_Customer.dim_Customer_key = MOSSDW.dbo.fact_Invoice.dim_Customer_key Inner Join dbo.dim_Moss_Calendar On dbo.dim_Moss_Calendar.dim_Moss_Calendar_key = MOSSDW.dbo.fact_Invoice.dim_Moss_Calendar_key Where dbo.dim_data_source.data_source = 'BPCS'