Orlando
|
| Posted: 10/24/2004, 1:34 PM |
|
I need to display only the records wich date are between 0 and 45 days older based on the "s_Date" parameter in the url.
I know how to do it in sql, but I cant get it to work in CCS, How can I tell SQL to use the parameter in the DATEDIFF function?
ASP, SQL, IIS
|
|
|
 |
mrachow
Posts: 509
|
| Posted: 10/25/2004, 1:07 AM |
|
Hi Orlando,
I would first create a session variable for example
session("StartDate") = DateAdd("d", -45, CCGetParam("s_Date", Empty))
Than using that session variable and the parameter in the sql where condition wizard. There you can choose these types of parameters for where.
Regards,
Michael
_________________
Best regards,
Michael |
 |
 |
Orlando
|
| Posted: 10/25/2004, 7:30 AM |
|
And How I should use this variable in the SQL statement?
I'm creating a "Statement of account" that should show payments that are 15, 30, and 45 days old.
All payments are in the same table, with the amount and date of the payment, the user should specify a date range in a search form, this would be the "s_Date" parameter, and I need to Sum the payments based on that date
|
|
|
 |
mrachow
Posts: 509
|
| Posted: 10/25/2004, 8:11 AM |
|
You should use the table parameter dialog (a subdialog of data source). On left hand side you have available all database fields and on the right you can enter the parameters name and type. In your case name s_Date and type URL plus Name "StartDate" and type session.
To compute the total there is an example in Component Reference under Examples and Techniques (2.1.3 Simple report with Total).
Regards,
Michael
_________________
Best regards,
Michael |
 |
 |
|