CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Grid display records by current date

Print topic Send  topic

Author Message
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 .
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


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.