Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsCustom Date RangeCustom Date Range
Previous
 
Next
New Post
5/3/2012 6:18 AM
 
Mark,

My recommendattion is that you upgrade to 5.0.3 (which has bug fixes over 5.0.1 and will still work on DNN 5.1.1), and the use the value that will come in in ModuleIDs as I have described above.

In versions 4.1.1 to 5.0.2 we handled parameters being passed into EventsGetByRange in a different way, but this was improved in 5.0.3.

Cheers
Roger

DNN MVP
Events - Get the latest version - Upgrade now!!
Feedback 6.4.2 - Now available - Give it a go!
Find us on Codeplex - DNN Events, DNN Feedback
Requirements/Bugs - Please submit them on Codeplex
 
New Post
5/3/2012 10:48 AM
 

Roger you sir are a saint.

 I did the module update and can see the new stored procedure.  Much easier to work with for a layman like myself.

I imagine I just have a simple syntax error now.  The script executes but does not have any noticeable effect, meaning my conditional is doing nothing.  If I replace all the references manually in the SQL of @EndDate and @BeginDate  with '2012-12-13' and '2012-01-01' then I get the desired result.

Again thanks a million for all your help with this.

Here is the current SQL the part I added in BOLD:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


/**** EventsGetByRange ****/

ALTER PROCEDURE [dbo].[EventsGetByRange]
(
 @ModuleIDs nvarchar(255),
 @BeginDate datetime,
 @EndDate datetime,
 @CategoryName nVarchar(50)
)
AS
SET DATEFORMAT mdy

IF @ModuleIDs = N'618'
 Select @BeginDate = '2012-01-01'
 Select @EndDate = '2012-12-31'


CREATE Table #EventIDs
    (EventID Int, NoOfRecurrences Int, LastRecurrence DateTime)


INSERT INTO #EventIDs (EventID, NoOfRecurrences, LastRecurrence)
SELECT DISTINCT e.EventID, Count(E2.EventID) as NoOfRecurrences, Max(E2.EventDateBegin) as LastRecurrence
 FROM dbo.[Events] E
 LEFT OUTER JOIN dbo.[EventsMaster] M ON E.ModuleID = M.SubEventID
 LEFT JOIN dbo.[Events] as E2 ON E.RecurMasterID = E2.RecurMasterID
 WHERE ((E.EventTimeBegin <= DATEADD(DAY,1,@EndDate) AND DATEADD(minute,E.Duration,E.EventTimeBegin) >=  @BeginDate) OR
   (E.EventTimeBegin BETWEEN @BeginDate AND DATEADD(DAY,1, @EndDate)))
   AND E.Approved = 1
   AND E.Cancelled = 0
   AND (E.ModuleID in (SELECT * FROM dbo.[SplitIDs](@ModuleIDs)))
GROUP By E.EventID

SELECT E.PortalID, E.EventID, E.RecurMasterID, E.ModuleID, E.EventDateBegin, E.EventDateEnd,
 E.EventTimeBegin, E.Duration, E.EventName, E.EventDesc,
 E.Importance, E.CreatedDate,
 CreatedBy = U.DisplayName,
 E.CreatedByID,
 E.Every,
 E.Period,
 E.RepeatType,
 E.Notify,
 E.approved,
 E.Signups,
 E.MaxEnrollment,
 (Select count(*) from dbo.[EventsSignups] WHERE EventID = E.EventID and E.Signups = 1) as Enrolled,
 ET.NoOfRecurrences,
 ET.LastRecurrence,
 E.EnrollRoleID,
 E.EnrollFee,
 E.EnrollType,
 E.PayPalAccount,
 E.Cancelled,
 E.DetailPage,
 E.DetailNewWin,
 E.DetailURL,
 E.ImageURL,
 E.ImageType,
 E.ImageWidth,
 E.ImageHeight,
 E.ImageDisplay,
 E.Location,
 c.LocationName,
 c.MapURL,
 E.Category,
 b.CategoryName,
 b.Color,
 b.FontColor,
 E.Reminder,
 E.TimezoneOffset,
 E.SendReminder,
 E.ReminderTime,
 E.ReminderTimeMeasurement,
 E.ReminderFrom,
 E.SearchSubmitted,
 E.CustomField1,
 E.CustomField2,
 E.EnrollListView,
 E.DisplayEndDate,
 E.AllDayEvent,
 E.OwnerID,
 OwnerName = O.DisplayName,
 E.LastUpdatedAt,
 LastUpdatedBy = L.DisplayName,
 E.LastUpdatedID,
 (Select ModuleTitle from dbo.[Modules] WHERE ModuleID = E.ModuleID) as ModuleTitle,
 RMOwnerID = r.OwnerID,
 r.RRULE,
 E.OriginalDateBegin,
 E.NewEventEmailSent
 FROM dbo.[Events] E
 inner join dbo.[EventsRecurMaster] AS r on E.RecurMasterID = r.RecurMasterID
 left outer join dbo.[Users] U on E.CreatedByID = U.UserID
 left outer join dbo.[Users] O on E.OwnerID = O.UserID
 left outer join dbo.[Users] L on E.LastUpdatedID = L.UserID
 left join dbo.[EventsCategory] b on E.Category = b.Category
 left join dbo.[EventsLocation] c on E.Location = c.Location
 left join #EventIDs ET on E.EventID = ET.EventID
WHERE E.EventID in (Select EventID from #EventIDs)
   AND (b.CategoryName = @CategoryName or @CategoryName = N'')
ORDER BY E.EventDateBegin, E.EventTimeBegin, E.EventDateEnd

 
New Post
5/3/2012 11:31 AM
 

I think you need:-

IF @ModuleIDs = N'618'
Select @BeginDate = '2012-01-01'
IF @ModuleIDs = N'618'
 
Select @EndDate = '2012-12-31'

Also make sure you have no sub-calendars, otherwise moduleids will be '618,nnn,nnn' etc

Cheers
Roger


DNN MVP
Events - Get the latest version - Upgrade now!!
Feedback 6.4.2 - Now available - Give it a go!
Find us on Codeplex - DNN Events, DNN Feedback
Requirements/Bugs - Please submit them on Codeplex
 
New Post
5/3/2012 11:58 AM
 

hmm still no go.

Is there a way I can view the SQL that has been run? I'm trying to figure out if it's the conditional statement or variable setting statement that is the problem.

 
New Post
5/3/2012 12:06 PM
 
Don't know of a way to see what has been run within the sproc.

Are you sure you have no sub-calendars? Other than that, you could get into SQL Server Management Studio, then you could query the values you have configured.

I did test the structure I showed above against my DB, so I'm pretty sure it works.

DNN MVP
Events - Get the latest version - Upgrade now!!
Feedback 6.4.2 - Now available - Give it a go!
Find us on Codeplex - DNN Events, DNN Feedback
Requirements/Bugs - Please submit them on Codeplex
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsCustom Date RangeCustom Date Range


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out