*---------------------- Location Section ------------------------ * Library: Asearchcontrols.vcx * Class: Cntsearchdaterange * Method: Getwhereexpression() *----------------------- Usage Section -------------------------- *) Description: *) * Scope: Public * Parameters: *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 08/12/2005 - NN * MODIFIED *---------------------------------------------------------------- local lcRetVal, loControl, lcDateFrom, lcDateTo lcRetVal = "##ALIAS##." + strextract(this.cSeparator + this.cFldName + this.cSeparator, ; this.cSeparator, this.cSeparator,1) do case case not empty(this.txtDateFrom.value) and not empty(this.txtDateTo.value) lcRetVal = "(" + m.lcRetVal + ">=" + this.ValToStr(this.txtDateFrom.value) + ; " AND " + m.lcRetVal + "<" + this.ValToStr(this.txtDateTo.value + 1) + ")" case not empty(this.txtDateFrom.value) lcRetVal = m.lcRetVal + ">=" + this.ValToStr(this.txtDateFrom.value) case not empty(this.txtDateTo.value) lcRetVal = m.lcRetVal + "<" + this.ValToStr(this.txtDateTo.value + 1) otherwise lcRetVal = "" endcase this.cWhereExp = strtran(m.lcRetVal,"##ALIAS##", this.cAliasName) return m.lcRetVal>Hi all,
> >local lcSql,lcWhere > >lcSql = "" >lcWhere = "" > >lcSql = " select * from client " > >Local lcTxtDueDate,lcTxtDelDate > >lcTxtDueDate = "DueDate>='[StartDate]' And DueDate<='[EndDate]'" >lcTxtDueDate= Strtran( lcTxtDueDate, "[StartDate]", Dtoc(date()) >lcTxtDueDate= Strtran( lcTxtDueDate, "[EndDate]", Dtoc(date()) > >lcTxtDelDate = "DeliveryDate>='[StartDate]' And DeliveryDate<='[EndDate]'" >lcTxtDelDate= Strtran( lcTxtDelDate, "[StartDate]", Dtoc(date()) >lcTxtDelDate= Strtran( lcTxtDelDate, "[EndDate]", Dtoc(date()) > >lcWhere = " where " + lcTxtDueDate + " and " + lcTxtDelDate > >lcSql = lcSql + lcWhere > >