How to Group By Value passed in Where Clause???

  • Thread starter Thread starter Bill Unger
  • Start date Start date
B

Bill Unger

Got a tough one here....

I have a report that displays about 5 different fields. The report is
called from a form ( vb in the form ) that builds a custom where clause
using the LIKE sql syntax. This is done b/c the criteria field is a
comma-separated list of values. As an example, I want to display the fields
Make and Model where the Color is LIKE '%Red%" - and the actual db value for
the Color field in the table could be "Red,White,Blue,Orange" - also,
multiple records could have "Red" in the Color field. AND... I want the
report to contain a Grouping on "Red"

Is this even possible?

tia,
Bill
 
Could you set up the sorting and grouping on an expression like:
HasColor: Instr([YourField],"Red") > 0
 
Can a Grouping be defined by an expression?


Duane Hookom said:
Could you set up the sorting and grouping on an expression like:
HasColor: Instr([YourField],"Red") > 0

--
Duane Hookom
MS Access MVP


Bill Unger said:
Got a tough one here....

I have a report that displays about 5 different fields. The report is
called from a form ( vb in the form ) that builds a custom where clause
using the LIKE sql syntax. This is done b/c the criteria field is a
comma-separated list of values. As an example, I want to display the fields
Make and Model where the Color is LIKE '%Red%" - and the actual db value for
the Color field in the table could be "Red,White,Blue,Orange" - also,
multiple records could have "Red" in the Color field. AND... I want the
report to contain a Grouping on "Red"

Is this even possible?

tia,
Bill
 
Yes. You must preface the expression with "=" like:
=Weekday([DateField]) = 4

--
Duane Hookom
MS Access MVP


Bill Unger said:
Can a Grouping be defined by an expression?


Duane Hookom said:
Could you set up the sorting and grouping on an expression like:
HasColor: Instr([YourField],"Red") > 0

--
Duane Hookom
MS Access MVP


Bill Unger said:
Got a tough one here....

I have a report that displays about 5 different fields. The report is
called from a form ( vb in the form ) that builds a custom where clause
using the LIKE sql syntax. This is done b/c the criteria field is a
comma-separated list of values. As an example, I want to display the fields
Make and Model where the Color is LIKE '%Red%" - and the actual db
value
for
the Color field in the table could be "Red,White,Blue,Orange" - also,
multiple records could have "Red" in the Color field. AND... I want the
report to contain a Grouping on "Red"

Is this even possible?

tia,
Bill
 
Back
Top