CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Events (showing only those for next 7 days)

Print topic Send  topic

Author Message
RipCurl
Posted: 02/13/2003, 2:39 PM



I have an events table in my database, that uses event_id, event, description and date (date refers to the day it happens). How would I construct a grid to show ONLY those events that occur from now till only 7 days from now. I will have events posted that will happen say a year from now, but I dont want those to show up till they are supposed to.

Any help appreciated ( Using CC 2.0.5 and PHP with templates)
DaveRexel
Posted: 02/13/2003, 3:11 PM

Here is an example that uses date functions. The following query selects all records with a date_col value from within the last 30 days:

mysql> SELECT something FROM tbl_name
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;

=== similar logic

Hope this helps you as it once helped me :)

Greetings
Dave
RipCurl
Posted: 02/13/2003, 3:43 PM

Thanks, but where do i insert this code into CC for the Grid? In the SQL? or Custom show?
RipCurl
Posted: 02/13/2003, 3:45 PM

I should add that the "date" column in the table is using MySql's date format (0000-00-00).

In addition, how do I diplay the dat as MM-DD-YYYY in the grid?
Ripcurl
Posted: 02/13/2003, 6:52 PM

Just to say I got it to work. Had to swtich the TO_DAYS around, so that it displayed hte correct info ^_^

Dani

   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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