Page 1 of 1

use of alias in conditions

PostPosted: Thu Sep 15, 2011 3:37 pm
by Jacques
Hi,

I want to add a condition linked to an alias and I don't succeed.
If the field is a text field, do I need to put apostrophes around the alias ( >'@alias1' )
and if it's an integer ?
This point is solved. I have found that I need to put the apostrophes in the value of the alias in the user management.

In the SQL condition "J2.zipcode > @alias1 and J2.zipcode < @alias2" doesn't work. I receive as error message
Conversion failed when converting the varchar value 261-31 to data type int.


The Zipcode field is a text field.

Jacques

Re: use of alias in conditions

PostPosted: Thu Sep 15, 2011 4:04 pm
by Carsten Sørensen
put the ' in the SQL - not in the alias value.

alias values are inserted without any type-related quotes in Free SQL conditions.

best regards
Carsten

Re: use of alias in conditions

PostPosted: Thu Sep 15, 2011 6:10 pm
by Jacques
It works !

Thanks

Jacques