1"-"位置
FIND("-",C5,1)

2"-"位置
FIND("-",C5,FIND("-",C5,1)+1)

3"-"位置
FIND("-",C5,FIND("-",C5,FIND("-",C5,1)+1)+1)

4"-"位置

FIND("-",C5,FIND("-",C5,FIND("-",C5,FIND("-",C5,1)+1)+1)+1)

取1位:

LEFT(C5,LEN(C5)-(LEN(C5)-FIND("-",C5,1)+1))

取2位:

mid(C5,2位置+1,3位-2位-1)

取3位:

mid(C5,3位置+1,4位-3位-1)

取4位:

mid(C5,4位置+1,长度-4位-1)

'3_cpc_plan'[plan_new]

'3_cpc_plan'[plan_new],
FIND("-",'3_cpc_plan'[plan_new],FIND("-",'3_cpc_plan'[plan_new],1)+1),
FIND("-",'3_cpc_plan'[plan_new],FIND("-",'3_cpc_plan'[plan_new],FIND("-",'3_cpc_plan'[plan_new],1)+1)+1)-FIND("-",'3_cpc_plan'[plan_new],FIND("-",'3_cpc_plan'[plan_new],1)+1)

)

ACCESS判断

Iif(LEFT(a.推广单元_temp, 2) = "海投", "海投计划", Iif(LEFT(a.推广计划, 2) = "秒杀", "秒杀计划", Iif(Instr(a.推广单元_temp, "-"),mid(a.推广单元_temp,instrrev(a.推广单元_temp,"-",instrrev(a.推广单元_temp,"-")-1,1)+1,instrrev(a.推广单元_temp,"-")-instrrev(a.推广单元_temp,"-",instrrev(a.推广单元_temp,"-")-1,1)-1), a.推广单元_temp))) AS [SKU Name], Iif(LEFT(a.推广单元_temp, 2) = "海投", "海投计划", Iif(LEFT(a.推广计划, 2) = "秒杀", "秒杀计划", LEFT(a.推广创意, Instr(1, a.推广创意, "-") - 1))) AS [SKU ID]

=LEFT(C5,LEN(C5)-(LEN(C5)-FIND("Ԫ",C5,1)+1))

找寻文字所在位置(左)
Instr(字段,"")

逻辑
iif(pool,"")

left(字段,字数)
mid(字段,起始,字数)

找寻文字所在位置(又)
instrrev (字段,"")

由于Instr起始字符是第一个参数,可以从这里入手。
第一个- instr([字段],"-")
第二个- instr(Instr([字段],"-")+1,[字段],"-")+1
第三个- instr(instr(Instr([字段],"-")+1,[字段],"-")+1,[字段],"-")
以此类推

Last modification:August 29th, 2018 at 12:12 pm
性感博主,在线要饭