Desktop productivity for business analysts and programmers

Proper query syntax for a "character-type" variable"

Accepted Solution Solved
Reply
Contributor
Posts: 42
Accepted Solution

Proper query syntax for a "character-type" variable"


I'm using the EG Query builder to try to query a Character string composed as follows: 505546433549 to try to find that record.

What is the proper method to use to query in th above case?

I've tried using double quotes e.g. "505546433549" and single quotes '505546433549' without success


Accepted Solutions
Solution
‎08-14-2014 08:14 AM
Frequent Contributor
Posts: 124

Re: Proper query syntax for a "character-type" variable"

I'm not sure to understand everything but

if you have a character variable with an observation containing '505546433549'

then in your querry filter you should be able to write

VariableX

Equal to

505546433549 (without quotes)

Enclose values in quotes (check this)


OR


"505546433549" (with quotes, double or single)

Enclose values in quotes (unchecked)


Does this help ?

View solution in original post


All Replies
Solution
‎08-14-2014 08:14 AM
Frequent Contributor
Posts: 124

Re: Proper query syntax for a "character-type" variable"

I'm not sure to understand everything but

if you have a character variable with an observation containing '505546433549'

then in your querry filter you should be able to write

VariableX

Equal to

505546433549 (without quotes)

Enclose values in quotes (check this)


OR


"505546433549" (with quotes, double or single)

Enclose values in quotes (unchecked)


Does this help ?

Community Manager
Posts: 2,692

Re: Proper query syntax for a "character-type" variable"

Like said, but in a picture:

filter.png

Grand Advisor
Posts: 9,571

Re: Proper query syntax for a "character-type" variable"

Maybe your variable contains some invisible character . try COMPRESS().

compress(var1, ,'kd') = "505546433549"

Xia Keshan

Contributor
Posts: 42

Re: Proper query syntax for a "character-type" variable"

All great points and answers.

Thank all of you!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 316 views
  • 3 likes
  • 4 in conversation