brandx
Posts: 29
|
| Posted: 06/19/2004, 9:08 PM |
|
Codecharge Studio (latest)
ASP/Access
I have a field "ExpDate" where i enter a date value that represents when it a service will expire... I would like to do one or both of the following..
1. Have a page where it only shows the records that will expire within 30 days...
2. Have an email sent to me if a record will expire within 30 days....
Any Ideas?
TIA,
Geary
|
 |
 |
LV
|
| Posted: 06/20/2004, 6:52 AM |
|
I am not sure exactly how to implement in CCS but this should work in Access query. So I am assuming that you will need to create an SQL statement for your page.
In Access query you create a new colum and
Expired: IIf([ExpDate]-Date()<30,[ExpDate],IsEmpty([ExpDate])) and set the criteria to >0
If you click on SQL in Access query you will have something like this
SELECT tblJobs.RecordID, IIf([ExpDate]-Date()<30,[ExpDate],IsEmpty([ExpDate])) AS Expired
FROM tblJobs
WHERE (((IIf([ExpDate]-Date()<30,[ExpDate],IsEmpty([ExpDate])))>0));
Good luck, if you get it to work please share the details with us.
|
|
|
 |
brandx
Posts: 29
|
| Posted: 06/22/2004, 8:12 PM |
|
Hi LV
I got it working with the following
SQL = "SELECT TOP {SqlParam_endRecord} * " & _
"FROM HostingDomain"
CountSQL = "SELECT COUNT(*) " & _
"FROM HostingDomain"
Where = "DomainExpire<=Date()+30"
Order = "DomainExpire"
I tried adding the code in bold within the codecharge studio datasource screen but couldn't get it to work.... so I added it manually in code view.
Geary
|
 |
 |
LV
|
| Posted: 06/23/2004, 6:29 AM |
|
Thanks for sharing, your solution is helpful on my next project that dealing with date calculation.
|
|
|
 |
|