SQL Error due to DateRangeStartAutoGlob

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 2
Joined: Wed Jul 09, 2014 9:42 am
PostPosted: Wed Jul 09, 2014 1:07 pm
I recently went through and did a Full Integration of SeedCode Calendar Pro into my system instead of just linking. Everything seems to be in correctly now with the exception of one thing. Anytime that I try to pull up a calendar such as Week, Day, or Month I get a SQL error. After reviewing some of the forum posts and reviewing the error's instructions. I also reviewed some of the data viewer statements and found the issue as best that I can find.

SELECT a."zscTimestampStartCalcNum", ''||a."__KP_JobID", a."JOB_Date Start", a."JOB_Date End", a."TimeStart", a."TimeEnd", ''||a."JOB_Date Due" , 1, a."zscTimestampEndCalcNum" FROM "SampleEvents" a where a."zscTimestampStartCalcNum" Between and
Union SELECT a."zscTimestampStartCalcNum", ''||a."__KP_JobID", a."JOB_Date Start", a."JOB_Date End", a."TimeStart", a."TimeEnd", ''||a."JOB_Date Due" , 1, a."zscTimestampEndCalcNum" FROM "SampleEvents" a where a."zscTimestampEndCalcNum" Between and
Union SELECT a."zscTimestampStartCalcNum", ''||a."__KP_JobID", a."JOB_Date Start", a."JOB_Date End", a."TimeStart", a."TimeEnd", ''||a."JOB_Date Due" , 1, a."zscTimestampEndCalcNum" FROM "SampleEvents" a where a."zscTimestampStartCalcNum" < and a."zscTimestampEndCalcNum" > ORDER by 1


The part in RED should have the date range that is applicable to what is being viewed on screen as far as I understand. I also went through some of the code and found that the two pieces of information are the global fields DateRangeStartAutoGlob and DateRangeEndAutoGlob. However, I cannot for the life of me figure out when and where they should be written with the correct values. They just seem to stay blank all of the time no matter what happens.

Thanks in advance for the help.
SeedCode Staff
SeedCode Staff
Posts: 475
Joined: Wed Jan 02, 2013 11:47 am
PostPosted: Wed Jul 09, 2014 1:16 pm
Check the auto-enter calculation for the DateRangeStartAutoGlob and DateRangeEndAutoGlob fields. Make sure the code isn't commented out or missing any references.
Posts: 2
Joined: Wed Jul 09, 2014 9:42 am
PostPosted: Wed Jul 09, 2014 2:45 pm
I have checked several times, and I cannot find anything wrong with it. I pasted the code into my dataviewer and with the exception of having to expand the field names to include the table name:: It works just fine in the Original SeedCode Calendar, it however does not work in my solution. So, the code in there seems to be ok, but there is something that is not coming into it and I am not sure what it would be.

This is the code as it sits in my Data Viewer.

Code: Select all
Case (

// --------------------  Grid  -------------------- 

PatternCount ( $$sc_Mode ; "Resource Sched Horiz" )  and CalendarInterface::TimeScaleGlob = "day" ;

Timestamp (
    CalendarRows::DateFocusGlob
;
    0
)

;

// --------------------  Day  -------------------- 

PatternCount ( $$sc_Mode ; "Day" ) or PatternCount ( $$sc_Mode ; "Resource" ) or PatternCount ( $$sc_Mode ; "Year" )   ;

Timestamp (
    CalendarRows::DateFocusGlob
;
    0
    // If ( PatternCount ( $$sc_Mode ; "Sched" ) ; CalendarInterface::TimeStartGlob ; 0 )
)

;

// --------------------  Week  -------------------- 

PatternCount ( $$sc_Mode ; "Week" ) ;

Timestamp (
    Let ( [
        d = CalendarRows::DateFocusGlob ;
        s = CalendarRows::DateStartWeekOnMondayGlob = "Yes"
    ] ;
        If ( DayOfWeek ( d ) = 1 and s = 1 ;
            d - 7 + 1 ;       
            d - DayOfWeek ( d ) + 1 + ( If ( s ; 1 ; 0 ) )
        )
    )
;
    0
    // If ( PatternCount ( $$sc_Mode ; "Sched" ) ; CalendarInterface::TimeStartGlob ; 0 )
)
 ;

// --------------------  Month & Gantt  -------------------- 

PatternCount ( $$sc_Mode ; "Month" )   ;

Timestamp (
    Let ( [
        d = CalendarRows::DateFocusGlob ;
        FirstDay = Date ( Month ( d ) ; 1 ; Year ( d ) ) ;
        FirstDayofCalendar = FirstDay - DayOfWeek ( FirstDay ) + 1 +

        (
        Case (
        CalendarRows::DateStartWeekOnMondayGlob = "Yes" and DayOfWeek ( FirstDay ) = 1 ; -6 ;
        CalendarRows::DateStartWeekOnMondayGlob = "Yes"
        )
        )

    ] ;
        FirstDayofCalendar
    )
;
    0
) ;

// --------------------  Gantt  -------------------- 


If ( PatternCount ( $$sc_Mode ; "Gantt" ) ;

If  ( IsEmpty ( CalendarRows::DateByHandStartGlob ) ;

Timestamp ( CalendarRows::DateFocusGlob ; 0 )

; // Else


Timestamp ( CalendarRows::DateByHandStartGlob ; 0 )

) )

) // End Case


Side Note: I just checked the End Date Glob code and the Date is not coming in correctly, but a lot of it is based off of the CalendarRows::DateRangeStartAutoGlob so there really is not a way it could come in correctly. The math seems to work on the code, but the fields are not being populated. Even as I change the date in the calendar interface the Dataviewer code will change the dates as needed, but the field still is not being populated.

I hope that all makes sense. Thanks again for the help.
SeedCode Staff
SeedCode Staff
Posts: 475
Joined: Wed Jan 02, 2013 11:47 am
PostPosted: Wed Jul 09, 2014 4:50 pm
I can't really tell what's wrong just from looking at that code, but if you don't mind sending me your file I should be able to help you figure it out. You can send it to me at [email protected] and be sure to include the full-access login information. -Jeff

Return to SeedCode Calendar

Who is online

Users browsing this forum: Google [Bot] and 2 guests

(855) SEEDCODE
[email protected]
Follow us: