use of alias in conditions

Technical support

Moderators: Bob Cergol, Data Access, Cintac

use of alias in conditions

Postby Jacques » Thu Sep 15, 2011 3:37 pm

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
Jacques
 
Posts: 39
Joined: Tue Aug 30, 2011 5:30 pm

Re: use of alias in conditions

Postby Carsten Sørensen » Thu Sep 15, 2011 4:04 pm

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
User avatar
Carsten Sørensen
Certified Dynamic AI Professional
 
Posts: 304
Joined: Thu Aug 16, 2007 1:25 pm
Location: Copenhagen

Re: use of alias in conditions

Postby Jacques » Thu Sep 15, 2011 6:10 pm

It works !

Thanks

Jacques
Jacques
 
Posts: 39
Joined: Tue Aug 30, 2011 5:30 pm


Return to Technical Support

cron