[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

need SQL query

EE Experts,

I have a table with the following fields:

ID (pk auto-generated)
SAMNO
LOCCODE
LOCATION
MYDATE
OWNER
COUNTY
ANALYTE
ELEMENT
METHOD
PQL
RESULT
RLTUNIT
QUALIFY
PROJECT
VALDATE

I need a query with these conditions:
1) shows all fields,
2) only displays where ELEMENT = 'Fe'
3) sets RESULT = (0.5 * RESULT) if QUALIFY = "U"
4) GROUPS BY LOCCODE, LOCATION, MYDATE (only unique LOCCODE-LOCATION-MYDATE are displayed)

This is part 1 of a 3 part question.
0
Cam Raben
Asked:
Cam Raben
2 Solutions
 
ste5anSenior DeveloperCommented:
And looks like homework..
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This sounds a bit like homework....
Anyhow, please read up this article
http://mobile.experts-exchange.com/Database/Miscellaneous/A_3203-DISTINCT-vs-GROUP-BY-and-why-does-it-not-work-for-my-query.html
Some comment down shows syntax about access
0
 
Dale FyeCommented:
@ T Bell,

For the most part, the experts here are EE are not here to solve your problems for you; we are here to help teach you so that you can solve your Access problems yourself.  You have received a number of examples over the past week (including Query_01_Result) in the database I posted this morning, which does almost exactly what you are asking for.  

Have you tried to take what was given to you in response to your previous questions and modify it to get what you are looking for?
0
 
Cam RabenAuthor Commented:
Yes, I've spent about 32 hours (most of last week) working on this one problem (basically all last week and today).  My persistence alone should speak volumes (I'm not over here sitting around waiting for EE to do this for me)....I simply need help getting my data in a format I can use.  If I could figure out how to solve this more quickly I would definitely have done so....I am a trained senior hydrologist who works very hard to produce quality work for the state agency for which I work.  Our budgets are too tight to hire this out, so I am attempting to do it myself.   I am not a SQL guy...and yes, I have poured over the various partial solutions over he course of last week and this morning trying to get SQL or VBA to do what I need.  

And yes, I opened and attempted to use the three queries you sent in chemical3.mdb but, unfortunately, they do not do what I need.  I also tried to apply the concepts in them to get them to work.
0
 
Cam RabenAuthor Commented:
@Guy - Thanks for the links.

@Dale - Thanks for the earlier help.  I have come up with a bit of a long-hand workaround, using your and Aikimark's responses from my earlier posting.   In retrospect, I should have written the original question more clearly or perhaps even in a different way.  In any case, I appreciate all your help.   - T
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now