SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mousemee
Starting Member

Singapore
1 Posts

Posted - 03/16/2013 :  00:43:32  Show Profile  Reply with Quote

Hi, i am currently practicing sql using access vba.

i created a statement

SELECT APPTLOOKUPTABLE.APPT
FROM APPTLOOKUPTABLE
WHERE (((APPTLOOKUPTABLE.DEPT) Like [DEPTCB].[Value]))

IT WORKED WHEN I TRIED IT AS AN SQL QUERY, SHOWING ME A LIST OF APPOINTMENTS WITHIN MY TABLE.

HOWEVER, WHEN I INSETED IT INTO VB ACCESS, IT ONLY RETURNED A SINGLE VALUE, WHICH IS THE FIRST VALUE WITHIN THE TABLE THAT IS EQIALS TO DEPTCB.VALUE


WHEN I ADDED THE KEYWORD DISTINCT, HOWEVER, IT WORKED PERFECTLY FINE. I DO NOT UNDERSTAND HOW THIS COULD BE.

ANY HELP IS APPRECIATED.

Mar
Starting Member

44 Posts

Posted - 03/19/2013 :  08:24:51  Show Profile  Reply with Quote
Magic!

Could be human error. Try it again creating a new query from scratch.

Could be machine is tired, reboot and try it again.

Try different fields and tables to see what works and what doesn't.

If you get the same results then its probably a bug in Access or you have something really different with your installation or setup.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000