473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Query look up!

Presto731
I have a table that has mileage between two points. Each point has a unique id#

in my query I want to be able to type in the id for point 1 and then type the id for point 2 and get the mileage. I know by simply putting [enter] in the criteria field for point one i can look up that one, how do make it so you enter both id#'s and get the mileage for those two points.

any thoughts?
Aug 2 '07 #1
9 1788
damonreid
114 Expert 100+
Milage has to be from somewhere by default. Are they both from the same location and you want to find the difference?
Aug 2 '07 #2
Milage has to be from somewhere by default. Are they both from the same location and you want to find the difference?

the table with the data looks like this:

point 1 point 2 mileage between them
xxx yyy 1234
yyy zzz 5678
zzz xxx 9101
etc...............................

there are about 1200 total

both point colums have the same info. so point xxx has mileage to all but xxx, yyy has mileage to all but yyy, so on............

my goal is to enter in a point and instead of seeing mileage to all the other s i want to enter the second point and just see that.

I hope i';m explaining this correctly.
Aug 2 '07 #3
JKing
1,206 Expert 1GB
Is this what you're looking for?

Expand|Select|Wrap|Line Numbers
  1. Select point1, point2, mileage
  2. FROM tblPoints
  3. WHERE point1 = [Enter Point1] and point2 = [Enter Point2]
  4.  
Aug 2 '07 #4
lol, thats the long and short of it
Aug 2 '07 #5
JKing
1,206 Expert 1GB
Well that would provide criteria for both points. Prompting the user to enter point1 followed by point2 and bringing up only that specific record. What more would you like?
Aug 2 '07 #6
where exactly do i type that code
Aug 2 '07 #7
JKing
1,206 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. Select point1, point2, mileage
  2. FROM tblPoints
  3. WHERE point1 = [Enter Point1] and point2 = [Enter Point2]
  4.  
Start a new query. Then instead of design view or datasheet view go into SQL view. This is where you would put the SQL I posted. Just make sure you change the field names to reflect your actual field names. Same goes for the table name.

point1 = Point 1 field name
point2 = Point 2 field name
mileage = mileage field name
tblPoints = table the data is stored in
Aug 2 '07 #8
Start a new query. Then instead of design view or datasheet view go into SQL view. This is where you would put the SQL I posted. Just make sure you change the field names to reflect your actual field names. Same goes for the table name.

point1 = Point 1 field name
point2 = Point 2 field name
mileage = mileage field name
tblPoints = table the data is stored in

will do, thank you for your help
Aug 2 '07 #9
JKing
1,206 Expert 1GB
If you run into any problems let me know.

Good Luck

Jking
Aug 2 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
9
by: wiredog | last post by:
I am struggling rewriting my query from MS Access' IIF, Then to SQL Servers TSQL language. I am hoping some one can give me some guidance. I believe I have the first portion of the query correct...
4
by: Orion | last post by:
Hi, This is kind of last minute, I have a day and a half left to figure this out. I'm working on a project using ms-sqlserver. We are creating a ticket sales system, as part of the system, I...
13
by: Dmitry Tkach | last post by:
Hi, everybody! Here is a weird problem, I ran into... I have two huge (80 million rows each) tables (a and b), with id as a PK on both of them and also an FK from b referencing a. When I try to...
2
by: Stephen Bowyer | last post by:
I have an Access 97 database, which we use with a VB5 front end. If I create a new query in the database, the string functions left, mid etc do not work. For example the query: CalcField:...
2
by: Fendi Baba | last post by:
I created a person table with various fields such as Suffix, Salutation, etc, Some of these fields may not be mandatory for example suffix. In the actual table itself, I only have a field for...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
3
by: Phil Stanton | last post by:
I have a number of queries which use code for the output of 1 or more fields. For example Address:GetAddress(AddressID, True, 60) Address ID Points to an Address in a table - Address Line1, Line...
2
AccessIdiot
by: AccessIdiot | last post by:
Hello all, I have a report that is based on a crosstab query. One of the fields in the crosstab query is based on a query. It is a coded value. When I look at the crosstab query it displays the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.