From: Peter Brawley Date: April 22 2009 6:07pm Subject: Re: my final 1064 error List-Archive: http://lists.mysql.com/mysql/217235 Message-Id: <49EF5CC6.5060201@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------020506040808040704000304" --------------020506040808040704000304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Matthew >SELECT Vouchers.VoucherID, Vouchers.VoucherCode, Vouchers.StartDate, Vouchers.EndDate, Vouchers.Discount, Vouchers.VoucherTypeID >FROM Vouchers >WHERE (((DateDiff('d',[StartDate],Date()))>=0) AND ((DateDiff('d',[EndDate],Date()))<=0)); Square brackets and your DateDiff syntax are MSSQL, not MySQL. PB ----- Matthew Stuart wrote: > Here is my final problem that I am struggling to overcome... > > > SELECT Vouchers.VoucherID, Vouchers.VoucherCode, Vouchers.StartDate, > Vouchers.EndDate, Vouchers.Discount, Vouchers.VoucherTypeID > FROM Vouchers > WHERE (((DateDiff('d',[StartDate],Date()))>=0) AND > ((DateDiff('d',[EndDate],Date()))<=0)); > > > Basically, the error is on the WHERE line of the query, and I assume > it is something to do with the DateDiff, but I don't know if there is > a MySQL equivalent. Also, is Date() valid MySQL? > > Thanks. > > Mat > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.0.238 / Virus Database: 270.12.2/2074 - Release Date: 04/22/09 08:49:00 > > --------------020506040808040704000304--