Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Posts
    33

    Unanswered: SQL Query only works in the afternoon?

    Okay. I am at a loss on this one. Below is the code that I am running to view all scheduled subscriptions in my SSRS. But it only works later in the day. I do however see new subscriptions I set up before they run. Any ideas?

    Code:
    use [ReportServer$MyDatabase]
    SELECT DISTINCT c.Name AS RptName, 
    sc.Name AS SchedName, 
    su.LastStatus, 
    su.LastRunTime AS SubLast, 
    sc.LastRunTime AS SchedLast, 
    sc.NextRunTime,
    MinutesInterval as MinInt,
    DaysInterval as DaysInt,
    WeeksInterval as WeeksInt,
    Month,
    DaysOfWeek,
    MonthlyWeek,
    DaysOfMonth, 
    sc.RecurrenceType, 
    c.Path
    FROM dbo.Catalog AS c INNER JOIN
     dbo.ReportSchedule AS rs ON c.ItemID = rs.ReportID INNER JOIN
     dbo.Schedule AS sc ON rs.ScheduleID = sc.ScheduleID INNER JOIN
     dbo.Subscriptions AS su ON rs.SubscriptionID = su.SubscriptionID 
    WHERE sc.NextRunTime > GetDate()

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Code:
    WHERE sc.NextRunTime > GetDate()
    or
    Code:
    WHERE sc.NextRunTime > convert(date, GetDate())

  3. #3
    Join Date
    Jun 2010
    Posts
    33
    Code:
    WHERE sc.NextRunTime > GetDate()
    Is already in my query... So I also tried the below you said..

    Code:
    WHERE sc.NextRunTime > convert(date, GetDate())
    still same issue.

  4. #4
    Join Date
    Jun 2010
    Posts
    33
    ah.. found the issue... Got rid of the Where clause and it works now..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •