Access DB Table - Split Field SQL Command

后端 未结 1 1503
自闭症患者
自闭症患者 2021-01-24 12:56

I have an Access 2013 Database Table, dbo_GOV

THE GOAL

I want to take the USSenators field, which contains data like (below) and split it into

1条回答
  •  别那么骄傲
    2021-01-24 13:05

    You cannot use Split in a query, use Mid and Instr.

    Mid(USSenators,Instr(USSenators,";")+1)
    Mid(USSenators,1,Instr(USSenators,";")-1)
    

    Line 2 above returns John Smith for the first record
    Line 1 above returns Sarah Levens for the first record

    You will need to watch for nulls.

    0 讨论(0)
提交回复
热议问题