ckroon
Posts: 869
|
| Posted: 08/11/2006, 7:28 PM |
|
Mysql 5.0 /Php 4.0
I have a grid that needs to display records that are coming due within 6 months of the current date.
I have no idea how to get the grid to filter this data properly.
Any advice is greatly appreciated.
Date format is mm/dd/yyy
Thanks!
_________________
Walter Kempees...you are dearly missed. |
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/12/2006, 3:34 AM |
|
SELECT DATE_ADD(curdate(),INTERVAL 6 MONTH);
straight from the MySQL Manual
will give you 6 months from today.
SELECT * FROM TABLE
WHERE yourdatefield > DATE_ADD(curdate(),INTERVAL 6 MONTH)
should give you all rows from TABLE in which yourdatefield is GT today + 6 months.
In a Grid
press the grid DataSource
in the VQB (Visual Query Builder) click the Where clause
press the "+" to be ale to add a condition
change type to expression and enter the complete where clause there.
Walter
_________________
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
|
 |
 |
ckroon
Posts: 869
|
| Posted: 08/12/2006, 9:30 AM |
|
Walter, you are seriously THE MAN!
Thanks so much!
All hail Walter!
_________________
Walter Kempees...you are dearly missed. |
 |
 |
|