From: zyus on 25 Mar 2010 03:24 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.
From: Daryl S on 25 Mar 2010 09:52 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.
From: GBA on 25 Mar 2010 09:53 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.
From: KARL DEWEY on 25 Mar 2010 11:15 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.
|
Pages: 1 Prev: How to make code timeout after 20 seconds (prevent freezing) Next: DIALOG FORM SIZE |