Hi all
I have a script that is running successfully
<?php
include("include/dbcommon.php");
global $dal;
$dalTableName = $dal->Table("Document");
$rstmp = $dalTableName->Query("DATEDIFF(day, GETDATE(), Schheduled_date)>=6","");
while ($datatmp = db_fetch_array($rstmp))
{
$email='my.emailaddress@me.co.uk';
$msg="Document Due";
$msg.="Job Number: ".$datatmp["Job_no"]."\r\n";
$msg.="Document Type: ".$datatmp["Document_type"]."\r\n";
$msg.="Document Required: ".$datatmp["Schheduled_date"]."\r\n";
$subject="Document Due";
runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg));
}
Im looking to put a bit more accuracy into the where clause in the script,
I have tried the following. When i check the syntax it shows no errors. however when i run the script i receive a php error
$rstmp = $dalTableName->Query("DATEDIFF(day, GETDATE(), Schheduled_date)>=6",", and (DATEDIFF(day, GETDATE(), Schheduled_date)<=7","");
What i want to do is email all the records that are due in 6 or 7 days from the day the script is ran.
Can anyone show me the correct code.
Regards
Jason