Joe-Bloggs
Posts: 10
|
Posted: 02/05/2015, 5:22 PM |
|
I have a grid which I would like to display records by current date
using the Query builder I have used curdate() and now() as expressions but its not working.
The grid has three fields
entry_date
msg_title
member_name
Could any one provide examples of how I might do this .
|
|
|
eratech
Posts: 513
|
Posted: 02/05/2015, 11:02 PM |
|
Howdy - if 'entry_date' is a datetime or timestamp, you might need to convert it back to a 'date' to match curdate() (which returns date only).
If it's a 'date' type then it should be fine. Depends if you just need the date or datetime.
You probably won't match to 'now()' as it will try and match to the millisecond...
select * from membership
where date(entry_date) = curdate()
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
Joe-Bloggs
Posts: 10
|
Posted: 02/06/2015, 3:02 PM |
|
Hi Eric
My field is just 'date' , I had already tried where date(entry_date) = curdate() it generates a blank page, not even an error .
Thanks
|
|
|
eratech
Posts: 513
|
Posted: 02/07/2015, 8:15 PM |
|
Assuming there are actually records for curdate(), what happens if you use the 'Review Data' in the Query Builder, or run the query directly in MySQL? Do you get records?
And for the 'blank page' you mentioned: do you get a Page and Grid with no records, or a plain blank page?
If a blank page then I think something else is wrong - if no records are found, you should get a 'No Records' line in a Grid, not an error or no page at all.
There is an option in a Project > Properties to add 'Error Checking' to each page (it just adds an error reporting flag to top of code page) but that might help if you think there should be some other error.
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
Joe-Bloggs
Posts: 10
|
Posted: 02/08/2015, 3:51 AM |
|
Hi Eric
I am away from home for a few days, but will check this when I get back.
Its a blank page, nothing on the page. I have used another where clause using a table and this works so the problem is the curdate() where clause .
Thanks for your time
|
|
|
|