This topic is locked

List Needs To Filter Date By Default

2/29/2008 3:09:44 PM
PHPRunner General questions
L
lexxtank author

I need the main list page on my aviation project to sort the following by default:

DepartureDate Show dates Equal or More Than (aka now or later than) today's date. There is a deadline on this project, and any help is appreciated. Unfortunately I have zero knowledge of php, or sql so please put your help into "idiot terms" Thanks.

R
rafamarquez 3/1/2008

I need the main list page on my aviation project to sort the following by default:

DepartureDate Show dates Equal or More Than (aka now or later than) today's date. There is a deadline on this project, and any help is appreciated. Unfortunately I have zero knowledge of php, or sql so please put your help into "idiot terms" Thanks.


You have to put a WHERE clause in the SQL Query
Select recordid (id or primary key), desc, date from (realtablename) where date => today
(today) depends of the database you are using
and put the order by
a) order by date asc
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=26534&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' /> or order by date desc

L
lexxtank author 3/1/2008



You have to put a WHERE clause in the SQL Query
Select recordid (id or primary key), desc, date from (realtablename) where date => today
(today) depends of the database you are using
and put the order by
a) order by date asc
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=26535&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' /> or order by date desc



Can you give me some example code? The table is called flights, the primary key is flightid, and its a MySQL database Thanks

J
Jane 3/3/2008

Hi,
here is a sample:

select flightid,

desc_field,

date_field

from flights

where date_field>=curdate()

L
lexxtank author 3/5/2008

Hi,

here is a sample:



should I just copy paste this into custom code section in phprunner? Also which section of the list page should it go into? The before sql query section? Thanks

J
Jane 3/5/2008

Hi,
modify SQL query on the Edit SQL query tab in the PHPRunner.

S
shoppy 3/17/2008

Hi,

modify SQL query on the Edit SQL query tab in the PHPRunner.


Dear Jane,
Does this work te same with nummers?
We work with client numbers (0000-0000), these numbers are not the same as the unique numbers the clientID (Auto-increment) file gives them.

But we like to have our numbers listed by the highest number on top and the lowest number at the bottom.

Now we heve the latest added client on top, no matter what number it has. (thats because of the clientID number).
Can you give me a hint?
Thanks,
John

J
Jane 3/21/2008

John,
you need to add ORDER BY (descending) clause to your SQL query on the Edit SQL query tab.

S
shoppy 4/10/2008

John,

you need to add ORDER BY (descending) clause to your SQL query on the Edit SQL query tab.


Hi Jane,
In the Query Designer I selct the field I need (the one with the clientnumbers) and than I choose 'Sort Type' and choose 'descending'?

Is that it?

S
shoppy 4/10/2008

It Worked!!
hahaha, becoming a real programmer here!!
thanks Jane and others for your help.
muito feliz aqui