CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Partial date for search field?

Print topic Send  topic

Author Message
Jack_Walter

Posts: 39
Posted: 09/10/2008, 6:52 AM

Hi,

I'd like to be able to input only the day or day + month in a search field for my grid (and maybe the shortened year (08 instead of 2008). The german shortdate is used for the 8 digit value (e.g. 10.09.2008). If I don't use _exact_ this structure I get an error message like "Der Wert im Feld s_tour_departure_date ist nicht gültig. Benutzen Sie folgendes Format: ShortDate."

How can I adjust this textfield to be more tolerant so that I could also use e.g.:
10.9.
10.9.08
without getting any error message?

Regards,
Jack
View profile  Send private message
mentecky

Posts: 321
Posted: 09/10/2008, 7:21 AM

Jack,

I've never tried it but try setting your input to a text field and using "LIKE" in your search. It's just a guess here on my end.

Rick

_________________
http://www.ccselite.com
View profile  Send private message
Jack_Walter

Posts: 39
Posted: 09/10/2008, 9:07 AM

Hi Rick,

I can edit the data type for that field (from Date to Text), but is there a way to edit the search functionality in such a simple way, too?

When I switch to the code tab I search for the corresponding fieldname I'll get this block of code:

//Prepare Method @3-9E36E3E3  
    function Prepare()  
    {  
        global $CCSLocales;  
        global $DefaultDateFormat;  
        $this->wp = new clsSQLParameters($this->ErrorBlock);  
        $this->wp->AddParameter("1", "urls_tour_name", ccsText, "", "", $this->Parameters["urls_tour_name"], "", false);  
        $this->wp->AddParameter("2", "urls_tour_departure_date", ccsDate, $DefaultDateFormat, $this->DateFormat, $this->Parameters["urls_tour_departure_date"], "", false);  
        $this->wp->AddParameter("3", "urls_ship_ship_id", ccsInteger, "", "", $this->Parameters["urls_ship_ship_id"], "", false);  
        $this->wp->Criterion[1] = $this->wp->Operation(opContains, "tour.tour_name", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false);  
        $this->wp->Criterion[2] = $this->wp->Operation(opEqual, "tour.tour_departure_date", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsDate),false);  
        $this->wp->Criterion[3] = $this->wp->Operation(opEqual, "ship.ship_id", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsInteger),false);  
        $this->Where = $this->wp->opAND(  
             false, $this->wp->opAND(  
             false,   
             $this->wp->Criterion[1],   
             $this->wp->Criterion[2]),   
             $this->wp->Criterion[3]);  
    }  
//End Prepare Method

If I just edit this one:
  
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "tour.tour_departure_date", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsDate),false);  

From opEqual to opContains I get the same error message as before.

And If I do this:

  
        $this->wp->AddParameter("2", "urls_tour_departure_date", ccsText, "", "", $this->Parameters["urls_tour_departure_date"], "", false);  
  
        $this->wp->Criterion[2] = $this->wp->Operation(opContains, "tour.tour_departure_date", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), cssText),false);  

The error message is gone and I can find substrings (only day, only month, etc.) but when I use the seperator "." to combine a search for day + month nothing will be found.

Sorry, I'm not a programmer so I can try only the obvious things ;(

Regards,
Jack
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/13/2008, 7:41 AM

8-)
In fact I am subscribed to this one already.

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.