Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merging multiple records into just one 1

Status
Not open for further replies.

breezett93

Technical User
Jun 24, 2015
128
US
Capture2_nvgnmd.png


I am trying to remove all the zero values, and have the non-zero values form one complete record. In my example, that leaves TIMB and OAKW, but OAKW could be replaced by other choices. So, I never want TIMB to be the chosen value, always the other. I plan to use NOT "TIMB" as Criteria.

I tried using Group By and Max, but I get one record with OAKW values and one with TIMB values. Is there a better solution than what I tried?

Thanks
 
Yes, that did merge to one record. Why would a random expression work but not EdbSpc?

Capture2_v5glwf.png
 
It may be that you have [tt]EdbSpc[/tt] of [tt]OAKW[/tt] and [tt]TIMB[/tt] in your table, so if you Group it by that field, you get 2 records. When you 'trick' it by XYZ, there is no mention of [tt]EdbSpc[/tt] in your SQL


---- Andy

There is a great need for a sarcasm font.
 
Okay. So I need to get the EdbSpc value that is not TIMB and assign it to an expression. Then run the rest of the query to get everything to merge.

I created a second query to get the value; then linked it to the original query and it worked!!

Thank you for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top