A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query - Identify & group records



 
 
Thread Tools Display Modes
  #1  
Old March 25th, 2010, 07:24 AM posted to microsoft.public.access
zyus
external usenet poster
 
Posts: 210
Default Query - Identify & group records

I hv the following sample data

[Desc] [addfield]
black pepper chicken chicken
fried chicken chicken
sweet & sour fish -
chicken soup chicken
beef steak -

In a query is it possible to create additional field [addfield] that will
group part of data in [desc]. In my above example i want to group chicken.
  #2  
Old March 25th, 2010, 01:52 PM posted to microsoft.public.access
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Query - Identify & group records

Zyus -

You can use a parameter in a query to do this. Say your parameter was
[Enter Grouping]. Then in a new field in the query, you can have this:
AddField: =iif([Desc] like "*" & [Enter Grouping] & "*",[Enter
Grouping],"-")

When the query runs, a dialog box will come up with "Enter Grouping". You
can type in chicken or whatever, and see the results as you described.

--
Daryl S


"zyus" wrote:

I hv the following sample data

[Desc] [addfield]
black pepper chicken chicken
fried chicken chicken
sweet & sour fish -
chicken soup chicken
beef steak -

In a query is it possible to create additional field [addfield] that will
group part of data in [desc]. In my above example i want to group chicken.

  #3  
Old March 25th, 2010, 01:53 PM posted to microsoft.public.access
GBA
external usenet poster
 
Posts: 174
Default Query - Identify & group records


yes; you will want to research the InString method - along with Left,
Right, Mid....you can either google or go into VBA in Access and use the Help
in there ....manipulating test strings can then be applied in a query as a
calculated field....

"zyus" wrote:

I hv the following sample data

[Desc] [addfield]
black pepper chicken chicken
fried chicken chicken
sweet & sour fish -
chicken soup chicken
beef steak -

In a query is it possible to create additional field [addfield] that will
group part of data in [desc]. In my above example i want to group chicken.

  #4  
Old March 25th, 2010, 03:15 PM posted to microsoft.public.access
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Query - Identify & group records

Or you can use a table of Group_Item with field Stock and this query --
SELECT YourTable.[Desc], IIf([Desc] Like "*" & [Stock] & "*",[Stock],"") AS
Stock_Type
FROM YourTable, Group_Item
WHERE (((YourTable.[Desc]) Like "*" & [Stock] & "*"));


--
Build a little, test a little.


"Daryl S" wrote:

Zyus -

You can use a parameter in a query to do this. Say your parameter was
[Enter Grouping]. Then in a new field in the query, you can have this:
AddField: =iif([Desc] like "*" & [Enter Grouping] & "*",[Enter
Grouping],"-")

When the query runs, a dialog box will come up with "Enter Grouping". You
can type in chicken or whatever, and see the results as you described.

--
Daryl S


"zyus" wrote:

I hv the following sample data

[Desc] [addfield]
black pepper chicken chicken
fried chicken chicken
sweet & sour fish -
chicken soup chicken
beef steak -

In a query is it possible to create additional field [addfield] that will
group part of data in [desc]. In my above example i want to group chicken.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.