Using Function

BBBryan

Registered User.
Local time
Today, 13:30
Joined
Nov 13, 2010
Messages
122
Hi,
I have data that has been exported from excel

WO-20653276-welding [9101 Injector 1 Steam Heel Broken Drain Valve]
WO-20660073-welding [9309 Injector 7 Toe Broken Drain Valve]
WO-20634112-welding [8500 Fab & Install Piping ProducedWaterLine]

I would like to extract in a query these 2 extractions
9101 Injector 1 Steam Heel Broken Drain Valve
9309 Injector 7 Toe Broken Drain Valve
8500 Fab & Install Piping ProducedWaterLine
And
WO-20653276-9101 Injector 1 Steam Heel Broken Drain Valve
WO-20660073-9309 Injector 7 Toe Broken Drain Valve
WO-20634112-8500 Fab & Install Piping ProducedWaterLine

I have this in a Query but cannot get the last bracket off
Description:Mid([WorkOrderDescription],21)
And I don't know thre rest
WO & Decription:Mid([WorkOrderDescription],1,11)



thanks
BBryan
 
I would do it like this:

Code:
WO: Left([WorkOrderDescription],11)

Code:
Description: Mid([WorkOrderDescription],InStr([WorkOrderDescription],"[")+1,InStr([WorkOrderDescription],"]")-InStr([WorkOrderDescription],"[")-1)

If you want WO and description you can easily concatenate them:

WO_Desc: [WO] & [Description]
 
Thanks
that works perfect!
On the second code - I see how you did that
So the mid needs a start number and a end number. By using the instr function you can return a number for this mid function and even can use the +1 and -1 at the end.


Thanks again BBryan
 

Users who are viewing this thread

Back
Top Bottom