Somewhat complex 'group by' query

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi everybody,

there's an issue i had a problem with and i still don't know how to
solve it, so could somebody help me 'cause i'm missing something big.
In sql server i can solve this with the CASE statement, but it doesn't
work the same way in access 2007.

I have one table with these columns: RowID, Priority, Country,
Subject, Date.
RowID is of type Number (and it's primary key); Priority, Country and
Subject of type text; Date of type Date/Time.

What i need is query that gives this information:
number of rows per country, priority, month and group.
Group is defined by some string somewhere inside Subject field and
must be derived from it...
E.g. subject can be the following: "AAA subject number one", or
"Subject that has BBB inside it", or "Third subject of CCC group".
The groups are then : AAA, BBB, CCC and if it isn't set inside
subject, then the group is DDD.

As i see the problem, i need a procedure that returns which string is
inside subject and return it.

So the resulting table should contain the following columns:
country, month, priority, group, count_of_rows

How can this be done... if it can be done at all?

Thanks in advance.
.



Relevant Pages

  • After Nearly 2 Decades
    ... Still in Lebanon you have: ... same political unchanged system based on religious communities ... Environment of the country is the least priority ...
    (soc.culture.lebanon)
  • RE: Somewhat complex group by query
    ... Create a public function FindGroup in a module. ... Public Function FindGroup(Subject As String) As String ... I have one table with these columns: RowID, Priority, Country, ...
    (microsoft.public.access.queries)
  • Re: Empire of Evil
    ... since it was occupied the country started to flourish? ... paving roads wasn't the priority. ... In Soviet Russia (incl. ... But you has to take into account that it was Kremlin ...
    (soc.culture.baltics)
  • Re: What if Kovalainen is faster than Hamilton?
    ... given priority in McLaren he would have won the WDC by September. ... Everybody knows that (the brits pretend they don't but that's their ... "my country right or wrong" nature). ...
    (rec.autos.sport.f1)
  • Re: Yay! At last, no more guppy-gobbing!
    ... priority ... ... and get this country out of the shit-hole it's been stuck in ...
    (uk.media.tv.misc)