Expression Question for Removing Portion of Part Number

We have a query that returns part number CC830750-000395-849 inside a label. We have another label and only want to display the CC830750. The part # CC830750-000395-849 is contained in {Root Container.Label 2.text}
Is there a way to only display the base part code in that second label by writing an expression or something?

If the format stays the same (using the dash separator), you can try this:

left({Root Container.Label 2.text},indexOf({Root Container.Label 2.text},"-"))

Perfect! Thanks for the help.