Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5968921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:09:28+00:00 2026-05-22T20:09:28+00:00

This is my query to calculate distance using latitude longitude values . SELECT mm.mem_id,

  • 0

This is my query to calculate distance using latitude longitude values .

SELECT mm.mem_id, mm.profilenam, mm.photo_thumb, mm.city, mm.zip, mm.country, mm.state, ( 3956 *2 * ASIN( SQRT( POWER( SIN( ( 34.1012181 - ABS( latitude ) ) * PI( ) /180 /2 ) , 2 ) + COS( 34.1012181 * PI( ) /180 ) * COS( ABS( latitude ) * PI( ) /180 ) * POWER( SIN( (
ABS( - 118.325739 ) - ABS( longitude ) ) * PI( ) /180 /2 ) , 2 ) ) )
) AS distance
FROM members AS mm
WHERE mm.profile_type =  'C'
ORDER BY distance
LIMIT 0 , 10

i want the distance < 500 but when i put in query
… <500 AS distance , it doesn’t work
How can i get the final query.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:09:29+00:00Added an answer on May 22, 2026 at 8:09 pm

    Have you tried

    SELECT mm.mem_id, mm.profilenam, mm.photo_thumb, mm.city, mm.zip, mm.country, mm.state, ( 3956 *2 * ASIN( SQRT( POWER( SIN( ( 34.1012181 - ABS( latitude ) ) * PI( ) /180 /2 ) , 2 ) + COS( 34.1012181 * PI( ) /180 ) * COS( ABS( latitude ) * PI( ) /180 ) * POWER( SIN( (
    ABS( - 118.325739 ) - ABS( longitude ) ) * PI( ) /180 /2 ) , 2 ) ) )
    ) AS distance
    FROM members AS mm
    WHERE mm.profile_type =  'C'
    HAVING distance<500
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run the following query in SQLite 3: SELECT *, DISTANCE(latitude, longitude,
I'm trying to execute a query like this: SELECT Id,Name,Distance=dbo.CalculateDistance(Lat,Lon,@lat,@lon) FROM Requests WHERE Distance
I have found this query to calculate medians @myvar:=0; @rownum:=0; SELECT result.readdate, AVG(total_gallons) AS
I try to calculate the distance between two points (given the latitude/longitude of those
I have this query to calculate the most common days of the week and
I hace sql query through this i want to calculate the records after 05:00:00
this query SELECT * FROM tblContracts LEFT JOIN tblPartys ON tblContracts.id = tblPartys.Contract_id INNER
This query works fine for me: $query = SELECT p.topnode_id, p.param_key, p.param_value FROM tbl_params
This query selects all the unique visitor sessions in a certain date range: select
This query works: item = db.GqlQuery(SELECT * FROM Item WHERE CSIN = 13)[0] although

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.