Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 28th, 2005, 04:50 AM
Authorized User
 
Join Date: Jun 2005
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to connect2sandep
Default jet sql query help

In Access, I have two tables
Users(userID, UserName, Password, bool Online) and
Contacts(UserID, ContactID)
In Jet SQL please help me retrieve the username of contacts of a particular username
who are online.
please help me, i am stuck.

 
Old October 28th, 2005, 06:55 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

SELECT [UserName], [bool Online]
   FROM Users
   WHERE [bool Online] = True ' or Yes or -1 depending on your table design



mmcdonal
 
Old October 28th, 2005, 06:55 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Sorry, I didn't get the second table... hang on a sec...

mmcdonal
 
Old October 28th, 2005, 06:59 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

SELECT Users.UserName, Contacts.ContactID, Users.[bool Online]
FROM Users INNER JOIN Contacts ON Users.UserID = Contacts.UserID
WHERE (((Users.[bool Online])=Yes));

Where are you trying to make this query? Where are you getting the UserName?

HTH

mmcdonal
 
Old October 28th, 2005, 02:16 PM
Authorized User
 
Join Date: Jun 2005
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to connect2sandep
Default

i wanted to retrieve the contacts name. this query retrieves only the Contacts UserID. please help






Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL-Union works in Access but not in Jet tonatwinemaker Access ASP 5 February 20th, 2006 04:37 PM
Converting a Jet query to SQL that uses a function Mitch SQL Server 2000 5 February 28th, 2005 12:33 PM
HELP!!! Jet SQL: Error (80040e14) Coldendus Access VBA 3 December 14th, 2004 08:12 PM
Migrating from Jet to SQL Ray Pinnegar Access 2 October 8th, 2004 04:43 AM
complex SQL using JET-SQL andy_routledge SQL Language 3 October 2nd, 2003 10:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.