Hi -

VDF 16, SQL Express, Mertech Drivers or VDF 15.1 SQL Express, DAW Drivers.

I have a small table that has a DateTime field as a main field in an index. When I constrain by that field, I get very odd results. Please see the attached test view.

In a CJDBGrid or old style DBGrid, the first record shows twice. In a DBList, it shows once - as it does with a find loop in a plain List's DoFill procedure.

If I constrain by any other field in the table, no duplicate first line. No matter what Date/Time I constrain by (thus changing what the first record is), I get a duplicated first line in those 2 controls.

Another table in the same DB does not do this - so it must have something to do with this table. I have resorted it in the Mgmt. Console.

Any ideas? I'm stumped.

    Object oRcvChng_DD is a RcvChng_DataDictionary
        Procedure OnConstrain
            Forward Send OnConstrain
            Constrain RcvChng.Date ge (pdtToday(Self))

//What fills the property:

    Procedure Activate_View Returns Integer
        Integer iRetVal
        DateTime dtToday dtNow
        Move (CurrentDateTime()) to dtNow
        Move (DateSetMillisecond(dtNow, 0))   to dtNow    //To make it midnight of today
        Move (DateSetSecond(dtNow, 0))        to dtNow
        Move (DateSetMinute(dtNow, 0))        to dtNow
        Move (DateSetHour  (dtNow, 0))        to dtNow

        Set pdtToday to dtNow
        Send Rebuild_Constraints of oRcvchng_DD
        Forward Get msg_Activate_View to iRetval
        Procedure_Return iRetVal
Click image for larger version. 

Name:	ConstrainDT.PNG 
Views:	142 
Size:	24.0 KB 
ID:	3969