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

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
 
D

Duane Hookom

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

Bill Unger

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
 
D

Duane Hookom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top