[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

Square Root Calculation in Access

Wizards,

I am trying to calculate the distance between two points/buildings using Grid Reference's, heres what I have in Excel

Building 1 (B1)
B1 GRID North =  100500
B1 GRID East  =   100500

Building 2 (B2)
B2 GRID North =  100600
B2 GRID East  =   100700

=SQRT(((B2 GRID North-B1 GRID North)^2)+((B2 GRID East-B1 GRID East)^2))

Result: 223.6

Now I have tried using the same formula in an Access Select Query but can not use the same function SQRT, it does not exist? When I run the Quesry I get the message "Undefined function "SQRT" in expression".
If I use the SQR function this give me a higher value, I am not sure what to do?????

Please HELP!
Akkas  
0
Akkas
Asked:
Akkas
  • 3
  • 2
2 Solutions
 
Mike EghtebasDatabase and Application DeveloperCommented:
Use:

=(((B2 GRID North-B1 GRID North)^2)+((B2 GRID East-B1 GRID East)^2))^0.5
0
 
Gustav BrockCIOCommented:
In Access it is called SQR():

=SQR(([B2 GRID North]-[B1 GRID North])^2+([B2 GRID East]-[B1 GRID East])^2)

/gustav
0
 
AkkasAuthor Commented:
eghtebas:
The formula works great in Excel, as an alternative. However this does not operate in Microsoft Access. Results are far from what is achieved in Excel.

Cactus Data:
The result of the expression in Access is far less then my original result in Excel. I was expecting a value of 223.6 & I got 141.421.

I have played with these statements but have not had much luck in modifying them to provide a spot on result.

More ideas and suggestions please!!!
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
Gustav BrockCIOCommented:
From your own parameters:

? SQR((100600-100500)^2+(100700-100500)^2)
 223,606797749979

/gustav
0
 
AkkasAuthor Commented:
Gustav:
I was working late last night until 5am U.K. time, I picked up your statement and entered it incorrectly and kept on entering it in incorrectly..
I got it now..Thanks
Akkas
0
 
Gustav BrockCIOCommented:
Oh Boy. You better get a good night's sleep!

/gustav
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now