Re: Strange pseudo-coded query
This is way off topic and you should seek an MS Access help list. [Zip Code Distance Extractor] could refer to any number of diff things such as a column in a table, a table name, a field on a form. The ! also has several different meanings and you should be able to find it in help files. - Original Message - From: Thomas J Keller [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 01, 2001 3:53 Subject: Strange pseudo-coded query I am working with a commercially supplied database of zipcode numbers and related data. In the documentation, the following pseudo-coded SQL queries are included. I am mystified by two things here: 1) [Zip Code Distance Extractor] -- I have no clue as to what this is referring to 2) the use of the ! operator makes no sense to me in this context help? Thanks in advance... --- included text --- Programming Notes Zip Code Distance Calculator Tables: 1. CPA Firms Table (CPAFIRMS) Fields: 1) First Name 2) Middle Name 3) Last Name 4) Company 5) Address 1 6) Address 2 7) City 8) State 9) Zip Code - 10 digit 10) Delivery Point 11) County 12) Code Number 13) Zip Code - 5 digit 2. Zip Code - Latitude - Longitude Table (ZIP-LAT-LONG) Fields: 1) Zip Code - 5 digit 2) Latitude 3) Longitude 4) City 5) State 6) County Queries: 1. Find Center Zip Code Finds matching Latitude/Longitude from ZIP-LAT-LONG table. SQL CODE: SELECT [ZIP-LAT-LONG].[ZIP CODE], [ZIP-LAT-LONG].LATITUDE, [ZIP-LAT-LONG].LONGITUDE FROM [ZIP-LAT-LONG] WHERE ((([ZIP-LAT-LONG].[ZIP CODE])=[Forms]![Zip Code Distance Extractor]![Zip Code])); 2. Find Distance Calculates Distance from Center Zip Code Query against Zip Codes in the ZIP-LAT-LONG table. SQL CODE: SELECT [ZIP-LAT-LONG].[ZIP CODE], [ZIP-LAT-LONG].LATITUDE, [ZIP-LAT-LONG].LONGITUDE, ([ZIP-LAT-LONG]! [LATITUDE]-[FIND CENTER ZIP CODE]![LATITUDE])*69.1 AS [Distance Lat], (69.1*([ZIP-LAT-LONG]! [LONGITUDE]-[FIND CENTER ZIP CODE]![LONGITUDE])*(Cos([FIND CENTER ZIP CODE]![LATITUDE]/57.3))) AS [Distance Long], ((([Distance Lat]^2)+([Distance Long]^2))^0.5) AS Distance FROM [ZIP-LAT-LONG], [FIND CENTER ZIP CODE]; 3. Find Distance by Radius Limits the results of the Find Distance Query by the radius number. SQL CODE: SELECT [Find Distance].Distance, [CPAFIRM'S].COMPANY, [CPAFIRM'S].FIRST, [CPAFIRM'S].MIDDLE, [CPAFIRM'S].LAST, [CPAFIRM'S].ADDRESS1, [CPAFIRM'S].ADDRESS2, [CPAFIRM'S].CITY, [CPAFIRM'S].STATE, [CPAFIRM'S].ZIPCODE FROM ([Find Distance] INNER JOIN [ZIP-LAT-LONG] ON [Find Distance].[ZIP CODE] = [ZIP-LAT-LONG].[ZIP CODE]) INNER JOIN [CPAFIRM'S] ON [ZIP-LAT-LONG].[ZIP CODE] = [CPAFIRM'S].ZIP5 WHERE ((([Find Distance].Distance)=[Forms]![Zip Code Distance Extractor]![radius])) ORDER BY [Find Distance].Distance; --- end included text --- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Strange pseudo-coded query
Rolf Hopkins wrote: This is way off topic and you should seek an MS Access help list. Excuse me. I am working in MySQL. I see no reference whatever to MS Access in my message. How do you figure this is off topic? [Zip Code Distance Extractor] could refer to any number of diff things such as a column in a table, a table name, a field on a form. I suppose it could. There is no such table or column listed in the documentation that comes with this product. The ! also has several different meanings and you should be able to find it in help files. Help files for what? According to the books I have, the ! means NOT in the context of a SELECT clause. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Strange pseudo-coded query
Rolf Hopkins wrote: This is way off topic and you should seek an MS Access help list. Excuse me. I am working in MySQL. I see no reference whatever to MS Access in my message. How do you figure this is off topic? Sir, Rolf had no way of knowing that you didn't know that you were dealing with SQL statements generated by MS Access wizards. Parts of the statements have been altered by hand, but the over all style is unmistakable. For those of us familiar with MS Access, it is obvious that the SQL is not psuedo-SQL, but actual SQL created by MS Access and referring to objects in an Access application. [Zip Code Distance Extractor] could refer to any number of diff things such as a column in a table, a table name, a field on a form. I suppose it could. There is no such table or column listed in the documentation that comes with this product. It is a form in an Access application. From the SQL, you can determine some of the names of the fields on the form. But that's all I can tell you about it. The ! also has several different meanings and you should be able to find it in help files. Help files for what? According to the books I have, the ! means NOT in the context of a SELECT clause. In the context, it means 'menber of'. [Zip Code Distance Extractor] is a form which is a member of the Forms collection (an object in an Access database). [Zip Code] is a field which is a member of the [Zip Code Distance Extractor] form. Rolf quite naturally assumed that you were working with an Access database application (and so did I), and was trying to direct you to the Access help files. Bob Hall [EMAIL PROTECTED] Know thyself? Absurd direction! Command 'know' not recognized. Drat. I wanted a list server and got an epistemological skeptic instead. MySQL secret passwords: sql query database - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Strange pseudo-coded query
- Original Message - From: Thomas J Keller [EMAIL PROTECTED] To: Rolf Hopkins [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, July 02, 2001 2:49 Subject: Re: Strange pseudo-coded query Rolf Hopkins wrote: This is way off topic and you should seek an MS Access help list. Excuse me. I am working in MySQL. I see no reference whatever to MS Access in my message. How do you figure this is off topic? Because I don't know of any other DB that places square brackets around table names, column names, field names, etc. If you really are working with MySQL and you are using that code with MySQL, then you need to make a lot of changes. For starters, it is not a very good idea to have spaces in your table and column names even though you can. The square brackets need to be removed plus many other changes. [Zip Code Distance Extractor] could refer to any number of diff things such as a column in a table, a table name, a field on a form. I suppose it could. There is no such table or column listed in the documentation that comes with this product. U!! Now I'm confused. Is this code a part of someone else's software you purchased??? If so then maybe I understand. You are trying to MSAccess SQL statements with MySQL. This product was designed for MSAccess or even MSSQL, not MySQL. Sorry, I'm not that familiar with MSSQL. The ! also has several different meanings and you should be able to find it in help files. Help files for what? According to the books I have, the ! means NOT in the context of a SELECT clause. That's exactly what it means and it means that in many programming languages as well but if you read the MSAccess online help, you'll find that it also has other meanings. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Strange pseudo-coded query
I am working with a commercially supplied database of zipcode numbers and related data. In the documentation, the following pseudo-coded SQL queries are included. I am mystified by two things here: 1) [Zip Code Distance Extractor] -- I have no clue as to what this is referring to 2) the use of the ! operator makes no sense to me in this context help? Thanks in advance... --- included text --- Programming Notes Zip Code Distance Calculator Tables: 1. CPA Firms Table (CPAFIRMS) Fields: 1) First Name 2) Middle Name 3) Last Name 4) Company 5) Address 1 6) Address 2 7) City 8) State 9) Zip Code 10 digit 10) Delivery Point 11) County 12) Code Number 13) Zip Code 5 digit 2. Zip Code Latitude Longitude Table (ZIP-LAT-LONG) Fields: 1) Zip Code 5 digit 2) Latitude 3) Longitude 4) City 5) State 6) County Queries: 1. Find Center Zip Code Finds matching Latitude/Longitude from ZIP-LAT-LONG table. SQL CODE: SELECT [ZIP-LAT-LONG].[ZIP CODE], [ZIP-LAT-LONG].LATITUDE, [ZIP-LAT-LONG].LONGITUDE FROM [ZIP-LAT-LONG] WHERE ((([ZIP-LAT-LONG].[ZIP CODE])=[Forms]![Zip Code Distance Extractor]![Zip Code])); 2. Find Distance Calculates Distance from Center Zip Code Query against Zip Codes in the ZIP-LAT-LONG table. SQL CODE: SELECT [ZIP-LAT-LONG].[ZIP CODE], [ZIP-LAT-LONG].LATITUDE, [ZIP-LAT-LONG].LONGITUDE, ([ZIP-LAT-LONG]! [LATITUDE]-[FIND CENTER ZIP CODE]![LATITUDE])*69.1 AS [Distance Lat], (69.1*([ZIP-LAT-LONG]! [LONGITUDE]-[FIND CENTER ZIP CODE]![LONGITUDE])*(Cos([FIND CENTER ZIP CODE]![LATITUDE]/57.3))) AS [Distance Long], ((([Distance Lat]^2)+([Distance Long]^2))^0.5) AS Distance FROM [ZIP-LAT-LONG], [FIND CENTER ZIP CODE]; 3. Find Distance by Radius Limits the results of the Find Distance Query by the radius number. SQL CODE: SELECT [Find Distance].Distance, [CPAFIRM'S].COMPANY, [CPAFIRM'S].FIRST, [CPAFIRM'S].MIDDLE, [CPAFIRM'S].LAST, [CPAFIRM'S].ADDRESS1, [CPAFIRM'S].ADDRESS2, [CPAFIRM'S].CITY, [CPAFIRM'S].STATE, [CPAFIRM'S].ZIPCODE FROM ([Find Distance] INNER JOIN [ZIP-LAT-LONG] ON [Find Distance].[ZIP CODE] = [ZIP-LAT-LONG].[ZIP CODE]) INNER JOIN [CPAFIRM'S] ON [ZIP-LAT-LONG].[ZIP CODE] = [CPAFIRM'S].ZIP5 WHERE ((([Find Distance].Distance)=[Forms]![Zip Code Distance Extractor]![radius])) ORDER BY [Find Distance].Distance; --- end included text --- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php