Find distance using aggregate

Find distance using aggregate

  

Hi all,

     I know that we can calculate the distance using SQL in outsystems.

     But is there a way to calculate the distance using aggregate in outsystems?


Regards, 

Gowtham

Hi Gowtham,

What do you mean by "distance" here? and how do you calculate it using SQL?

Hi Jorge,

     Thanks for your reply.

     Consider the following

     I am having two attributes in my user table as latitude and longitude. These attributes hold the latitude and longitude of old Westbury for one user and latitude and longitude of Hoboken for another user.

     Now I have to calculate the distance between the two users. This can be achieved using the SQL by using the following code

SyntaxEditor Code Snippet

SQRT(POWER(69.1 * ( @Latitude - convert(float,{user}.[Latitude])), 2) + POWER(69.1 * ( convert(float,{user}.[Longitude])  - @Longitute )   * COS(@Latitude / 57.29577951), 2))

.       But can this be achieved through aggregates?

        This is my question.

Hi Gowtham,

I think its distinct, is it?


Thanks

Rajendra Singh

Raj wrote:

Hi Gowtham,

I think its distinct, is it?


Thanks

Rajendra Singh


Distinct means what? The SQL.

I haven't tried it, but I'd say all Built-In functions that have a direct mapping on your DBMS are usable in an Aggregate's computed attribute.