Good Morning,
I know that i just have the syntax wrong on my code, but I can't tell what I am doing wrong. When I run the page, I get the email 25 times, as I have 5 records in the database.
Help Thanks Sue
My Code:
<cfquery name="tickler" datasource="Intranet">
Select ID, ProjectID, TaskID, Name, Customer, Unit, NonEESUnit, description, Startdate
From Tasks
Where StartDate <= #CreateODBCDate(DateAdd("d", -1, Now()))# AND Status = 'Open' AND Assigned = 'bwoods'
Order By TaskID
</cfquery>
</head>
<body>
<!---then sends a tickler email to tech--->
<cfloop query="tickler">
<cfif IsDefined("tickler.StartDate")>
<cfoutput query="tickler" group="id">
<cfmail
From="shigman@emeraldscreening.com"
To="shigman@emeraldscreening.com"
Subject="Task is still open">
This is a quick, computer-generated email sent to
remind you of that the following Task is still open. Please update.
Repair Order: #tickler.projectID#
Task Number: #tickler.taskid#
Customer: #tickler.customer#
Name: #tickler.name#
Unit: #tickler.unit#
Non Emerald Unit: #tickler.noneesunit#
Description: #tickler.description#
Start Date: #Dateformat(tickler.startdate, 'MM/DD/YY')#
Please Advise.
</cfmail>
</cfoutput>
</cfif>
</cfloop>
I know that i just have the syntax wrong on my code, but I can't tell what I am doing wrong. When I run the page, I get the email 25 times, as I have 5 records in the database.
Help Thanks Sue
My Code:
<cfquery name="tickler" datasource="Intranet">
Select ID, ProjectID, TaskID, Name, Customer, Unit, NonEESUnit, description, Startdate
From Tasks
Where StartDate <= #CreateODBCDate(DateAdd("d", -1, Now()))# AND Status = 'Open' AND Assigned = 'bwoods'
Order By TaskID
</cfquery>
</head>
<body>
<!---then sends a tickler email to tech--->
<cfloop query="tickler">
<cfif IsDefined("tickler.StartDate")>
<cfoutput query="tickler" group="id">
<cfmail
From="shigman@emeraldscreening.com"
To="shigman@emeraldscreening.com"
Subject="Task is still open">
This is a quick, computer-generated email sent to
remind you of that the following Task is still open. Please update.
Repair Order: #tickler.projectID#
Task Number: #tickler.taskid#
Customer: #tickler.customer#
Name: #tickler.name#
Unit: #tickler.unit#
Non Emerald Unit: #tickler.noneesunit#
Description: #tickler.description#
Start Date: #Dateformat(tickler.startdate, 'MM/DD/YY')#
Please Advise.
</cfmail>
</cfoutput>
</cfif>
</cfloop>