adding a 'search by date' to existing form
HI
I've used the DA wizard to create insert/update/delete pages and included the search facility. I now want to be able to search between 2 dates.
The code below works fine to search by different criteria:
$WADbSearch1->addComparisonFromEdit("pages.PgID","S_PgID","AND","=",1);
$WADbSearch1->addComparisonFromList("pages.PgTypeID","S_PgTypeID","AND","=",1);
$WADbSearch1->addComparisonFromList("pages.Under_PgID","S_Under_PgID","AND","=",1);
$WADbSearch1->addComparisonFromEdit("PgTitle","S_PgTitle","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("PgBriefDetails","S_PgBriefDetails","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("pages.MemOnly","S_MemOnly","AND","=",1);
$WADbSearch1->addComparisonFromEdit("pages.Active","S_Active","AND","=",1);
I have added two fields (S_StartDate and S_EndDate) to the form and tried adding the following 2 lines below the code shown above;
$WADbSearch1->addComparisonFromEdit("StartDate","S_StartDate","AND",">=",2);
$WADbSearch1->addComparisonFromEdit("StartDate","S_EndDate","AND","<=",2);
However, it doesn't work! All the other search criteria still work - but if I try to enter the dates into the form, then ALL records are returned.
(I have added datepickers to each of the form fields, if this makes any difference)
Any help much appreciated, as always.
Chris