This topic is locked
[SOLVED]

 need a little help with syntax

9/23/2010 7:06:24 AM
PHPRunner General questions
J
jasonfrew author

Hi all

Im running a script that emails the contents of a database table
$rstmp = $dalTableName->Query("DATEDIFF(day, GETDATE(), Schheduled_date)>=6","");
The above runs correctly and gives me all the records in the database that are due in 6 days.
What i would like to do is have the script email me everything that is 6 and 7 days from the day the script that is ran. what i expected the code to be is as follows
$rstmp = $dalTableName->Query("DATEDIFF(day, GETDATE(), Schheduled_date)>=6",", and (DATEDIFF(day, GETDATE(), Schheduled_date)<=7","");
This does not work. can you please show me the correct code.
Regards
Jason

A
ann 9/23/2010

Jason,
here is the correct syntax:

$rstmp = $dalTableName->Query("DATEDIFF(day, GETDATE(), Schheduled_date)>=6 and DATEDIFF(day, GETDATE(), Schheduled_date)<=7","");
J
jasonfrew author 9/23/2010



Jason,
here is the correct syntax:

$rstmp = $dalTableName->Query("DATEDIFF(day, GETDATE(), Schheduled_date)>=6 and DATEDIFF(day, GETDATE(), Schheduled_date)<=7","");



Thanks Ann
I was so close and yet so far away.
Regards

Jason