Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 28th, 2005, 04:50 AM
Authorized User
 
Join Date: Jun 2005
Location: Kathmandu, , Nepal.
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.

Reply With Quote
  #2 (permalink)  
Old October 28th, 2005, 06:55 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old October 28th, 2005, 06:55 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #4 (permalink)  
Old October 28th, 2005, 06:59 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #5 (permalink)  
Old October 28th, 2005, 02:16 PM
Authorized User
 
Join Date: Jun 2005
Location: Kathmandu, , Nepal.
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.