This topic is locked
[SOLVED]

 how do I search date columns?

12/15/2005 12:16:53 AM
PHPRunner General questions
T
TheSaint author

I have tried just about everything.

Sergey Kornilov admin 12/15/2005

Date search should work fine.

Just make sure that you use DATE or DATETIME column type for your date field and that you enter dates into "Search for" box in your local format. I.e. 12/15/2005, not 2005-12-15

T
TheSaint author 12/15/2005

Thanks I tried as you suggest and I get:
Error type 256

Error description You have an error in your SQL syntax near '\'2005-12-15 00:00:00\' ' at line 1
...
SQL query select `Id`, `InvoiceNumber`, `Dollars`, `DateReceived`, `LineNumber`, `DatePosted`, `CheckNumber`, `debit` From `ARCashReceipts` where `DatePosted`=\'2005-12-15 00:00:00\'

Date search should work fine.

Just make sure that you use DATE or DATETIME column type for your date field and that you enter dates into "Search for" box in your local format. I.e. 12/15/2005, not 2005-12-15

D
defcon2000 12/15/2005

I seem to be having a similar problem. Mine is:


Rgds,

T
Tommy B 12/15/2005

I seem to be having a similar problem. Mine is:


Rgds,


I had this problem as well. I changed the field type of my "Date" field to VARCHAR since the PHPRunner script formats the appearance of the date for me anyway it works for what I need it for. It may work for you if you don't mind the innacuracy.

T
TheSaint author 12/15/2005

Thanks for my application they must stay datetime type.
--steve
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7107&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />--><div class='quotetop'>QUOTE(Tommy B @ Dec 15 2005, 02:54 PM) <{POST_SNAPBACK}></div><div class='quotemain'><!--quotec-->



I seem to be having a similar problem. Mine is:

Rgds,


I had this problem as well. I changed the field type of my "Date" field to VARCHAR since the PHPRunner script formats the appearance of the date for me anyway it works for what I need it for. It may work for you if you don't mind the innacuracy.

[/quote]

Sergey Kornilov admin 12/16/2005

Hi,
thank you for pointing me to this bug. We'll fix it un the nect PHPRunner update.

To get your pages working now please modify

C:\Program Files\PHPRunner\source\include\functions.php file.

Locate the following snippet there:

else

$sSearchFor=db_addslashes($sSearchFor);

and replace it with:

else if(!IsDateFieldType($type))

$sSearchFor=db_addslashes($sSearchFor);

Then rebuild your project.
If you don't want to rebuild your project apply the same modifications to include\..._functions.php files in PHPRunner output folder.

T
TheSaint author 12/16/2005

Thanks,
Works perfectly and solved that problem. Only minor issue is sometimes the date picker disappears, other times a recompile solves the problem.
Note a related bug - when working on a project that is view only, a lot of the formatting controls are disabled so you have to enable "edit" and then setup for example the date format or lookup table and then remember to disable "edit".