4 Replies Latest reply: Jun 13, 2018 11:55 AM by Vishwarath Nagaraju

# Combining Data From One Table

Hello everyone,

I have one table:

[ID] AS [Record ID],

[CREATED_DATE] AS [CREATED_DATE],

[CREATED_BY] AS [CREATED_BY],

[equip] AS [Type Equipment],

[equiploc] AS [Location],

[firex_type] AS [firex_type],

[firex_size] AS [firex_size],

[bc_num] AS [Scanned BarCode Number],

[building] AS [Building],

[floor] AS [floor],

[my_scan] AS [Scanned Bar Code],

[completed_] AS [completed_],

[tech_] AS [tech_],

[retired_barcode] AS [retired_barcode],

[new_barcode_] AS [new_barcode_],

[buidling] AS [Other Buidling]

But both [bc_num] AS [Scanned BarCode Number] & [my_scan] AS [Scanned Bar Code] can have the same number, no number or just one of them has the number. So what I want it to do is combine them so that it displays in my table just one number:

I tried combing them by adding:

bc_num] &'-'& [my_scan] AS [Barcode Number],

But that gives me data like this:

What I need is for it to show the number just once.

Any ideas?

Thanks!

• ###### Re: Combining Data From One Table

Hi,

try this:

if(len(trim(bc_num))=0, my_scan, if(len(trim(my_scan))=0, bc_num)) as [Barcode Number],

• ###### Re: Combining Data From One Table

Try this?

Subfield([bc_num] &'-'& [my_scan], '-',1) AS [Barcode Number],

• ###### Re: Combining Data From One Table

This worked perfectly! So I needed to use Subfield. Thank you!

• ###### Re: Combining Data From One Table

Yes. No Problem.