CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Only Retrieving Records for today's date.

Print topic Send  topic

Author Message
jim7567g

Posts: 38
Posted: 12/20/2004, 8:53 AM

When a user enters a record I have a hidden field

{date} = (Date Type= Date, Format= mmddyyyy, Default Value= CurrentDate)

that enters today's date into a Integer field in the MySQL database.

The result is correct date = 12202004

When I try to retrieve records using a table I set the WHERE value to only pull records where:

date (integer) = {date} (control)

With this setting the grid pulls all records.

Can someone explain how I can get this filter to work correctly?

Thanks.

_________________
Jim
View profile  Send private message
jim7567g

Posts: 38
Posted: 12/20/2004, 10:45 AM

Maybe if I expand a little more I can find someone to help:

I am able to pull records where the date field matches NOW() using a SQL Query as follows:

SELECT *
FROM production_tracking
WHERE date = CURDATE( ) +0

This works correctly but I also need to filter the records by user_id and this is where the problem is.

I have been unable to figure out how to add this statement in SQL query correctly:

SELECT *
FROM production_tracking
WHERE date = CURDATE( ) +0
AND user_id = CCGet UserID()

or

SELECT *
FROM production_tracking
WHERE date = CURDATE( ) +0
AND user_id = user_id (with parameters: Variable = user_id, Type= Integer, Parameter source= CCGetUserID(), Type= Expression, Default Value= 0

Can someone help?

Thank you.


_________________
Jim
View profile  Send private message
jim7567g

Posts: 38
Posted: 12/20/2004, 11:21 AM

Ok I solved the problem, maybe this answer can help new folks like myself.

Use TABLE as the Data Source

In the Where Field:

uder_id = {Expr0} (Where Expro0 = Field= user_id, Condition= "=", Parameter source= CCGetUserID() Type Expression.

date = {Expro1} (Where Expro1 = Field date, Condition= "=", Parameter source= date("mdY") Type Expression.
_________________
Jim
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.