RaduNRV
(Radu Valentin Neacsu)
February 19, 2020, 6:28pm
1
Hello guys. I’m trying to use the select method and it works in the following format:
in_dtDataCID.Select(“Department = '”+row(“Department”).tostring +“'”).CopyToDataTable
As i will use this method in other processes (Subdepartments and Functions) i want to create a variable to replace the Department column and take the value of Subdepartments and also Functions:
new variable: in_Type
in_dtDataCID.Select(“'” +in_Type+ “’ = '”+row(in_type).tostring +“'”).CopyToDataTable
but it throws error that no rows found.
I’m guessing the problem is with this part here: ‘“+row(in_type).tostring +”’.
Much appreciated for your help!
@RaduNRV
You have single quotes around in_Type so the comparison being done is 'type'=
… instead of type=
…
If you remove those single quotes you should be fine.
RaduNRV
(Radu Valentin Neacsu)
February 19, 2020, 6:58pm
3
I’m afraid i don’t see where i should put the single quotes. Can you write it down? much appreciated
Use this instead:
in_dtDataCID.Select(in_Type+ “ = '”+row(in_type).tostring +“’”).CopyToDataTable
1 Like
RaduNRV
(Radu Valentin Neacsu)
February 19, 2020, 7:06pm
5
this works fine:
in_dtDataCID.Select(“” +in_Type+ " = ‘“+row(in_type).tostring+”’").CopyToDataTable
Many thanks @DanielMitchell for the solution!
1 Like
system
(system)
Closed
February 22, 2020, 7:06pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.