CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 [Date issue] Pulling records 60 days past due

Print topic Send  topic

Author Message
Chris__T


Posts: 339
Posted: 03/26/2008, 9:56 AM

Ok, so I'm trying to pull records that are 60 days past the current day (CurrentDate). In the VQB i put in the WHERE section:

Date_In_Table <= DateAdd("d",-60,current date)

that doesn't work. I also tried

Date_In_Table <= DateAdd("d",-60,"3/26/2008")

that doesn't work either.
View profile  Send private message
Chris__T


Posts: 339
Posted: 03/26/2008, 10:31 AM

I got it to work. First I stuck a hidden text box on the grid form and put the DateAdd code in there, setting it equal to the textbox. (Grid.Textbox.value)

Then in visual query builder, set Field as the date field from the table. Condition is "less than or equal to", then the Parameter is the hidden textbox and its type is set as "Form". It "works".

It's pulling all the data from the table. I think it has to do with trying to call a textbox value in the query. That form thing didn't work.

If you have a value in a textbox on the form, how can you implement that in your query (visual query builder)?
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/26/2008, 11:26 AM

In VQB Where:
Condition Type :Expression
Expression: Date_In_Table <= Date_Add(Current_date, INTERVAL -60 DAY)

Should solve it directly in VQB MySQL version!!!

expose DB flavour.
_________________
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
View profile  Send private message
Chris__T


Posts: 339
Posted: 03/26/2008, 12:48 PM

Except I'm using MS Access :-<
View profile  Send private message
Chris__T


Posts: 339
Posted: 03/26/2008, 12:58 PM

Date_in_Table <= DateAdd("d", -60, date()) is a no go as well.

All of my attempts were in Condition Type: Expression as well.
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/26/2008, 3:01 PM

Quote Chris__T:
I got it to work. First I stuck a hidden text box on the grid form and put the DateAdd code in there, setting it equal to the textbox. (Grid.Textbox.value)

Then in visual query builder, set Field as the date field from the table. Condition is "less than or equal to", then the Parameter is the hidden textbox and its type is set as "Form". It "works".

It's pulling all the data from the table. I think it has to do with trying to call a textbox value in the query. That form thing didn't work.

If you have a value in a textbox on the form, how can you implement that in your query (visual query builder)?

As per your earlier post, that method is right, type = Form or Application, genereates a CCGetFromPost, possibly it is getting the right data, but the less equal is having problems with the date format (again).
Switch to debug or response.write or whichever method you use and expose the actual SQL.
(If in VQB press the SQL button or the result button.

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
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.