This code works, but if I changes the dates, or even enter true the dates inside the editvars, the result is empty.
cStartDatum := {^ 2016/12/15 } is a strange why of configuring a date for me. What does it do ?
Dates where always a little bit hard, also in php, but how to tread them in FWH with SQL.
- Code: Select all Expand view
cPoule := "3B"
nMinAge := 41
nMaxAge := 50
// YYYY/M/D
cStartDatum := {^ 2016/12/15 }
cEndDatum := {^ 2017/01/08 }
msginfo(cStartDatum)
EDITVARS cPoule,cStartDatum,cEndDatum
//cStartdatum = substr(dtoc(cStartdatum),4,2)+"/"+substr(dtoc(cStartdatum),1,2)+"/20"+substr(dtoc(cStartdatum),7,8)
//cStartdatum = "20"+substr(dtoc(cStartdatum),7,8)+"/"+substr(dtoc(cStartdatum),4,2)+"/"+substr(dtoc(cStartdatum),1,2)
//msginfo(cStartDatum)
cFields:= "home, away, poule,dag,uitslag_thuis,uitslag_uit,date_format(dag,'%d %M %Y') AS Datedag"
oRs := oCn:RowSet( "select "+ cFields + " from `tbl_matchen` where `poule` = ? and dag >= ? and dag <= ? ",{ cPoule,cStartDatum,cEnddatum } )
ofthen used sql's in my soccer php program :
- Code: Select all Expand view
$query2 = mysql_query("SELECT *, voor - tegen as saldo from tbl_ploegen where poule = '$poule' and periode = '0'
ORDER BY punten DESC , gespeeld , winst DESC , gelijk DESC, verlies DESC, saldo DESC , voor DESC, landnaam") or die(mysql_error());
$query3 = mysql_query("SELECT *, date_format(dag,'%a %d %M %Y') as entry_date from tbl_matchen
where poule = '$poule' and (thuisploeg_id = '$ploeg' or uitploeg_id = '$ploeg') ORDER BY dag ") or die(mysql_error());