>>> LOCAL lcScript, lcStartDate, lcEndDate >>> IF USED("deliveries") >>> SELECT deliveries >>> USE >>> DROP VIEW deliveries >>> ENDIF >>> lcStartDate = ALLTRIM(STR(YEAR(Session.startdate))) + "-" + ; ALLTRIM(STR(MONTH(Session.startdate))) + "-" +; ALLTRIM(STR(DAY(Session.startdate))) + ' 00:00:00' >>> lcEndDate = ALLTRIM(STR(YEAR(Session.EndDate))) + "-" + ; ALLTRIM(STR(MONTH(Session.EndDate))) + "-" + ; ALLTRIM(STR(DAY(Session.EndDate))) + ' 00:00:00' >>> lcScript = "SELECT * FROM Deliveries"+ ; " WHERE Deliveries.deliverydate >= "+; "cast('" + ; ALLTRIM(lcstartdate) + ; "' as datetime) AND deliveries.deliverydate <= cast('" + ; ALLTRIM(lcenddate) + "' as datetime)" >>> EXECSCRIPT(lcScript) >>> IF !USED("deliveries") >>> USE deliveries IN 0 >>> ENDIF >>>>>
>>create sql view deliveries ; >> remote connection myConnection ; >> as ; >> select * FROM Deliveries ; >> WHERE Deliveries.deliverydate between ?ldStartDate and ?ldEndDate >>>>