What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » access query

access query
Author: Message:
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. access query
i have an access db with 10 different fields i want to make a number of different queries, but i want to query 7 out of the 10 fields each time and i can't get the query right so does anyone have any ideas?


[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














11-03-2008 06:16 AM
Profile E-Mail PM Find Quote Report
Adeptus
Senior Member
****


Posts: 732
Reputation: 40
Joined: Oct 2005
RE: access query
"SELECT OneThing, AnotherThing, ThirdThing FROM SomeTable"?
11-03-2008 06:47 AM
Profile E-Mail PM Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: access query
code:
SELECT Table.ID, Table.SNAME, Table.FNAME, Table.L1
FROM table
WHERE (((Table.L1) Like "text**"));
thats what it looks like for one field, and every time i try add Table.L2 i stuff it up somehow

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














11-03-2008 06:56 AM
Profile E-Mail PM Find Quote Report
Adeptus
Senior Member
****


Posts: 732
Reputation: 40
Joined: Oct 2005
RE: access query
I think you are getting parenthesis-happy there.  I see nothing that calls for use of all those parenthesis.

code:
SELECT Table.ID, Table.SNAME, Table.FNAME, Table.L1
FROM table
WHERE Table.L1 Like "text**"


...should be perfectly fine.  If you want to add another column to the condition, you could do something like:

code:
SELECT Table.ID, Table.SNAME, Table.FNAME, Table.L1
FROM table
WHERE Table.L1 Like "text**" AND Table.L2 <> 2
11-03-2008 07:05 AM
Profile E-Mail PM Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: access query
quote:
Originally posted by Adeptus
I think you are getting parenthesis-happy there.  I see nothing that calls for use of all those parenthesis.

code:
SELECT Table.ID, Table.SNAME, Table.FNAME, Table.L1
FROM table
WHERE Table.L1 Like "text**"


...should be perfectly fine.  If you want to add another column to the condition, you could do something like:

code:
SELECT Table.ID, Table.SNAME, Table.FNAME, Table.L1
FROM table
WHERE Table.L1 Like "text**" AND Table.L2 <> 2


that sql was generated by access
using your query i get

quote:
Originally posted by access 07
data type mismatch in crirtia expression

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














11-03-2008 07:14 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On