Sort off topic query about grouping on a date field

Posts   
 
    
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 03-Mar-2008 06:41:16   

Hey folks,

I have this frequent and annoying need to knock up dynamic lists where theres some grouping happening on a field of type smalldatetime. The problem is I'm interested in grouping on the day of that smalldatetime value, I don't care if the hours, mins, seconds etc is different.

So I keep having to write a view which pulls the bits out using DATEPART so values occurring on the same day but with a different time are grouped together.

Does anyone have any ideas how I might avoid this? Preferably something that keeps me in vs.net and not in studio manager.

Thanks.

**Curses: i've a typo in the subject heading (off-of). Plz fix for me simple_smile **

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 03-Mar-2008 10:08:02   

You can specify group by in DYnamicLists, and also you can use DBFunctionCall() as an expression to the grouped by field to call the DATEPART database function.

Please check the LLBLGen Pro manual's section "Using the generated code -> Calling a database function"