Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Field To Query Result

Status
Not open for further replies.

MrMeric

Technical User
Apr 1, 2004
48
US
Good day!

How would I go about adding a "YES/NO" field to my query results? I would like this to be the first field.

Here is my SQL
Code:
SELECT Lease.VIN, Lease.LeaseNumber, Customer.Name, Customer.Address, Vehicle.Make, Vehicle.Model, Vehicle.Year
FROM ((Vehicle INNER JOIN Tax ON Vehicle.VIN = Tax.VIN) INNER JOIN StatusActions ON Vehicle.VIN = StatusActions.VIN) INNER JOIN (Customer INNER JOIN Lease ON Customer.CustID = Lease.CustID) ON Vehicle.VIN = Lease.VIN
WHERE (((Lease.Archived)=-1));
 
eh, what do you mean yes/no field?

do you mean a field in one of your tables that contains boolean values, i.e. yes or no
Code:
select tblName.fieldName, ... from join... where...
Or do you mean a text field that just displays "Yes/No"
Code:
select 'Yes/No' AS yn, ... from ... where...
or what?
 
If you add a field to a query for a recordset, you achieve nothing. If you add it for a datasheet then how are you going to access the value the user enters? If you want it for a form-view then I can't see any purpose in passing a value-less field to the form. So - what are you trying to achieve? We can make some suggestions.

 
My application looks like this:
moveselected.gif

I would like the user to be able to check a box next to the record they wish to move, and click "Move Selected to Active Queue".

I thought about placing the records into a listbox, but they would have to hold Ctrl while they select each item. This could lead to disaster if you accidently clicked a record without holding Ctrl after you just selected 50 items.

Any ideas?
 
I'd be inclined to add a Y/N field to a table. You can then bind your ticks on the form to the data and run a simple query after they've finished selecting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top