Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Anyone here good with Access 2007?

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
Leftist Agitator Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 05:17 PM
Original message
Anyone here good with Access 2007?
I'm trying to finish up a project, and I'm pretty sure that either A - My copy of Access is somehow defective or B - My brain is somehow defective. Anyone able to lend a helping hand?
Printer Friendly | Permalink |  | Top
darkstar3 Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 05:19 PM
Response to Original message
1. I train people in it.
Ask away. :)
Printer Friendly | Permalink |  | Top
 
Leftist Agitator Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 05:27 PM
Response to Reply #1
2. OK, what I'm trying to do is make a Query...
Edited on Sat Mar-20-10 05:28 PM by Leftist Agitator
That will return a data subset of a table, specifically, entries above a numeric value from one column, and several entries from a column of text values that fit the aformentioned numerical criteria.

The numerical criterion enters and displays fine, but when I try to restrict the query to the text values from the other column, Access will only return the first appropriate text value from the specified criteria.

I've tried using the 'or' separator, the In() function, and I've tried entering each text value in a successive criteria field, and nothing seems to work.

If you need more explanation or screenshots, please feel free to ask.
Printer Friendly | Permalink |  | Top
 
darkstar3 Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 05:40 PM
Response to Reply #2
3. In the query builder window,
the word 'or' doesn't actually work on the criteria line. You have to stack your 'or' arguments vertically in the same column, AND each 'or' criterion is a comparative line all to itself.

Let me 'splain with an example. This won't be easy, given the textual limitations of board, but bear with me. In the following example, the character '--' is used as a column divider.

Field -- PayRate -- Name
...(snipping to jump to criteria)
Criteria -- >10 -- 'John'
Or -- (blank) -- 'Sally'


I'm assuming that this is how you've tried using the OR separator line in the past. Unfortunately, this doesn't work. The reason is that the lines beginning with OR are additive. The query builder window, when laid out as above will return a result set corresponding to the following description:
All people named John who are paid more than '10', and all people named Sally no matter what the Sallys are paid.

So, in the query builder window, start with your Name column (or whatever text column you're using), and "stack" your names, starting in the Criteria row and going down, one name per line. Then go over to your PayRate field (or whatever your numerical field is) and in each row where you have a name specified in the name column, REPEAT your numerical criterion. You should end up with something like this:

>10 -- John
>10 -- Sally
>10 -- Rose
>10 -- Jack

Make sense?
Printer Friendly | Permalink |  | Top
 
Leftist Agitator Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 05:44 PM
Response to Reply #3
4. I tried that. It didn't work. But I'll go back and try again, and report back to you.
And thank you for taking the time to help me out with this! :)
Printer Friendly | Permalink |  | Top
 
Leftist Agitator Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 05:56 PM
Response to Reply #3
5. Well, I tried it again, no luck.
Here are screenshots of the build table and the results that the query is returning:





And here is a screenshot of the original table:






Why in the hell is Access only returning records for Fords?! This is driving me insane. I've been stuck in front of this damn computer all day and already had to cancel one outing on this gorgeous 70 degree sunny day, I'm going to be irate if I miss my whole Saturday night because of this shit.
Printer Friendly | Permalink |  | Top
 
darkstar3 Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 06:05 PM
Response to Reply #5
6. Hmm...
Well, three things come to mind.

A. Try single quotes instead of doubles. That is, of course, if Access will let you do that.
B. Show me the In() function that you used before that didn't work.
C. In your next screenshot, use the view button in the upper left hand corner to switch to SQL View, then post that. That language is actually how Access gets its data, and the gui is writing it for you, so the gui may be making a mistake. I might be able to send a SQL query that will do it right.
Printer Friendly | Permalink |  | Top
 
Leftist Agitator Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 06:21 PM
Response to Reply #6
7. Well, the In() function was just that function on the criteria line for the make of vehicle...
With each value separated by a comma.

I tried single quotes, but of course, Access refused to cooperate.

Here's a screenshot of the SQL view:

Printer Friendly | Permalink |  | Top
 
darkstar3 Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 06:31 PM
Response to Reply #7
8. Alright, let's try this:
Edited on Sat Mar-20-10 06:41 PM by darkstar3
In the SQL view, change your WHERE line to the following:

WHERE Models.Make In('Ford','Chrysler','Chevrolet')

At that point, run the query and see what happens. Hopefully, the In function specified should show all the Fords, Chryslers, and Chevrolets in the list.

If it works, switch back to SQL View and make your WHERE clause look like this:

WHERE Models.Make In('Ford','Chrysler','Chevrolet') AND Models.{Highway MPG} >= 28

--------
Another option is to get pedantically specific:
WHERE Models.Make = 'Ford' AND Models.{Highway MPG} >= 28 OR
Models.Make = 'Chrysler' AND Models.{Highway MPG} >= 28 OR
Models.Make = 'Chevrolet' AND Models.{Highway MPG} >= 28

ETA: Argh, the HTML filter on here cut out part of what I was trying to show. The '{' and '}' in the previous code should be STRAIGHT brackets, not curly.
Printer Friendly | Permalink |  | Top
 
Leftist Agitator Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 06:38 PM
Response to Reply #8
9. Well, I tried all 3 suggestions in SQL...
Edited on Sat Mar-20-10 06:39 PM by Leftist Agitator
No luck there, either. It returned a syntax error on the boolean, and when I put in the Highway MPG tag, it still only returned Fords.

I give up... Life is too damn short to worry about this nonsense.


Oh, and darkstar3, THANK YOU for taking the time to help me with this! I appreciate it more than you know.
Printer Friendly | Permalink |  | Top
 
darkstar3 Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 06:42 PM
Response to Reply #9
10. Check back up there before you give up,
that syntax error may have technically been my fault. :)
Printer Friendly | Permalink |  | Top
 
Leftist Agitator Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 07:11 PM
Response to Reply #10
11. Seriously, don't worry about it.
I'm sure as hell not going to.

And again, I thank you for going out of your way to help me.
Printer Friendly | Permalink |  | Top
 
EvolveOrConvolve Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 08:24 PM
Response to Reply #11
12. Try this query
Edited on Sat Mar-20-10 08:24 PM by EvolveOrConvolve
SELECT Models.Make, Models.Model, Models.MSRP, Models.[City
MPG], Models.[Highway MPG], Models.Hybrid

FROM Models

WHERE ((Models.Make = 'Ford') OR (Models.Make = 'Chevrolet')
OR (Models.Make = 'Chrysler')) AND (Models.[Highway MPG] >=
28)


(I apologize for the messy formatting, DU's message board
software really isn't equipped to do code)
Printer Friendly | Permalink |  | Top
 
Leftist Agitator Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Mar-20-10 11:06 PM
Response to Reply #12
13. Thank you, but this didn't work either.
Edited on Sat Mar-20-10 11:11 PM by Leftist Agitator
I'm beginning to strongly suspect that my copy of Access has something very wrong with it.

I tried the same parameters as you and darkstar3 suggested on another machine, and it worked just as it should have, but on this machine, to no avail.

Oh well, that query will have to be done at some other juncture.
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Thu Apr 25th 2024, 12:34 AM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC