Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Condition help
Message
De
08/02/2006 15:40:29
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Condition help
Divers
Thread ID:
01094773
Message ID:
01094773
Vues:
54
Hi all,

Anybody can help me out how to split the below codes to meet the following
criteria :

If [startdate] is blank, considers the [enddate] as final filter means from [enddate] backward to any [startdate]

If both ( [Startdate] & [Enddate] ) are blank, take everything

If [Enddate] is blank, considers the [startdate] as beginning filter up until
to any date no limit for [Enddate].

Thank in advance,
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 
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform