Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I only want to see certain data from a specific field in a table. I have tried using several where clauses, but all fields keep loading in.
Here is what I have in my script:
SQL Select UserDefined1
FROM dbo.tblIncidentUtilityCross
WHERE UserDefined1 = 'New Customer', 'Existing Customer', 'New Dealer', 'Existing Dealer';
Any help would be appreciated.
Thanks
Try:
SQL Select UserDefined1
FROM dbo.tblIncidentUtilityCross
WHERE UserDefined1 in ('New Customer', 'Existing Customer', 'New Dealer', 'Existing Dealer');
Hope this helps!
I tried that and it still gave me all values in the field
hmm its working for me, do you have another table that just has the UserDefined1 field?
yes that field it is in multiple tables
Try this and see if you get the correct values in your table:
TableTest:
SQL Select UserDefined1 as UserDefined1Test
FROM dbo.tblIncidentUtilityCross
WHERE UserDefined1 in ('New Customer', 'Existing Customer', 'New Dealer', 'Existing Dealer');
If you do, then your table is being automatically concatenated to another table that has all the values. I don't know what you are doing in your script, so I can only guess.
or
LOAD *
Where Match(UserDefined1, 'New Customer', 'Existing Customer', 'New Dealer', 'Existing Dealer');
SQL Select UserDefined1
FROM dbo.tblIncidentUtilityCross;
hope this helps
regards
Marco
Thanks that worked. really appreciate it
Hi Toedtli,
In case you are having a problem of tables getting concatenated due to same column names.
You can also use Qualify which names the fields as Tablename.FieldName making the fields unique preventing concatenation.
1. For all fields: QUALIFY *
2. For specific fields QUALIFY fieldname1, fieldname2
3. Use UNQUALIFY * or UNQUALIFY fieldname1, fieldname2 when you want to disable this functionality.
Thanks,
Shoubhik.
Hi Toedtli,
Try using Match function in your script which works equivalent to IN in your SQL Script.
Load
*
where Match(UserDefined1,'New Customer', 'Existing Customer', 'New Dealer', 'Existing Dealer');
Hope it helps.
Regards
KC