Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concat and/or Pivot?

Status
Not open for further replies.

cabbey77

Technical User
Aug 6, 2004
68
US
I have:
<b>parent_id &emsp;&emsp;action &emsp;&emsp;&emsp;&emsp; first_date&emsp;&emsp; latest_date</b>
abc123&emsp;&emsp; BuyerPriceLockPrice__c &emsp;&emsp;&emsp;&emsp; 9/30/2019 &emsp;&emsp; 9/30/2019
abc123&emsp;&emsp; BuyerBasis__c&emsp;&emsp;&emsp;&emsp; 9/30/2019 &emsp;&emsp; 9/30/2019
abc123 &emsp;&emsp;GrowerCashPrice__c&emsp;&emsp;&emsp;&emsp; 10/10/2019 &emsp;&emsp; 10/10/2019
abc123 &emsp;&emsp; BuyerCashPrice__c&emsp;&emsp;&emsp;&emsp; 9/30/2019&emsp;&emsp; 10/10/2019
abc123 &emsp;&emsp; Buyer__c &emsp;&emsp; &emsp;&emsp; 9/19/2019&emsp;&emsp; 9/19/2019
abc125 &emsp;&emsp; Grower__c&emsp;&emsp;&emsp;&emsp; 8/28/2019 &emsp;&emsp; 12/16/2019
abc125 &emsp;&emsp; BuyerPriceLockPrice__c &emsp;&emsp;&emsp;&emsp; 6/26/2019 &emsp;&emsp; 6/26/2019
abc125 &emsp;&emsp; GrowerPriceLockPrice__c &emsp;&emsp;&emsp;&emsp; 6/26/2019 &emsp;&emsp; 6/26/2019

I need:

<b>parent_id &emsp;&emsp;actionfirst date&emsp;&emsp; action last date&emsp;&emsp;actionfirst date&emsp;&emsp; action last date&emsp;&emsp;actionfirst date&emsp;&emsp; action last date&emsp;&emsp;&emsp;&emsp;
</b>
where each action either has a date or is null. There are a total of 12 actions.

 
Hint for posting your data:
[pre]
parent_id   action      first_date   latest_date

abc123 [blue]BuyerPriceLockPrice__c[/blue]      9/30/2019    9/30/2019
abc123 BuyerBasis__c     9/30/2019    9/30/2019
abc123 GrowerCashPrice__c     10/10/2019    10/10/2019
abc123 BuyerCashPrice__c     9/30/2019   10/10/2019
abc123 Buyer__c       9/19/2019   9/19/2019
abc125 Grower__c     8/28/2019    12/16/2019
abc125 [blue]BuyerPriceLockPrice__c[/blue]      6/26/2019    6/26/2019
abc125 GrowerPriceLockPrice__c     6/26/2019    6/26/2019
[/pre]
Use [PRE] tag and Preview before Submit.


---- Andy

There is a great need for a sarcasm font.
 
What are the 12 actions? What order should they be in. The query isn't difficult but undo-able without those 2 pieces of information

Bill
Lead Application Developer
New York State, USA
 
'Actual_Delivered_Bushels__c','Buyer__c','BuyerBasis__c','BuyerCashPrice__c','BuyerPriceLockPrice__c','Delay_Reason__c','DeliveryWindowEnd__c','GrossBushels__c', Grower__c', 'GrowerBasis__c', 'GrowerCashPrice__c', 'GrowerPriceLockPrice__c'.

Order doesn't matter in the very least.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top