Complex query

Posts   
 
    
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 10-Dec-2004 19:45:33   

I've thought long and hard about the best way to do this, and it all boils down to whether or not I can do what I need to do with LLBLGen.

table: Reports field: Quarter field: Year

table: Members field: StartMonth field: StartYear

I need all Reports whos Quarter & Year are greater than the Quarter & Year of the Member's start date. The problem is that the quarter is not calculated for the Member's start date (ie Quarter is not a field in the Members table).

Can that be done somehow?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Dec-2004 20:37:27   

Not yet, you need a function to calculate the quarty out of the year/month in the member table rows

Frans Bouma | Lead developer LLBLGen Pro
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 10-Dec-2004 22:28:20   

Otis wrote:

Not yet, you need a function to calculate the quarty out of the year/month in the member table rows

I have that function, but it's in c# and therefore not usable in the prefetch path query, correct?

I want to pull down everything in one call to the database..

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 11-Dec-2004 11:31:54   

alexdresko wrote:

Otis wrote:

Not yet, you need a function to calculate the quarty out of the year/month in the member table rows

I have that function, but it's in c# and therefore not usable in the prefetch path query, correct?

I want to pull down everything in one call to the database..

No that function has to be in the database, so it is executed in teh SQL WHERE clause, per row that's joined.

Frans Bouma | Lead developer LLBLGen Pro