i want to count how many records where dealdeldate is in the current month and how many are forward of the current month.
many thanks to PHV
so far
dealdeldate is in the current month
SELECT Count(*) AS countfwdeal FROM tbl_deal WHERE 100*Year(dealdeldate)+Month(dealdeldate)=100*Year(getDate())+Month(getDate())
forward of the current month
SELECT Count(*) AS countfwdeal FROM tbl_deal WHERE 100*Year(dealdeldate)+Month(dealdeldate)>100*Year(getDate())+Month(getDate())
i get this error
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.0.21-debug]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '())+Month(GetDate())' at line 1
/dfasp2/dealanalysis.asp, line 42
many thanks to PHV
so far
dealdeldate is in the current month
SELECT Count(*) AS countfwdeal FROM tbl_deal WHERE 100*Year(dealdeldate)+Month(dealdeldate)=100*Year(getDate())+Month(getDate())
forward of the current month
SELECT Count(*) AS countfwdeal FROM tbl_deal WHERE 100*Year(dealdeldate)+Month(dealdeldate)>100*Year(getDate())+Month(getDate())
i get this error
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.0.21-debug]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '())+Month(GetDate())' at line 1
/dfasp2/dealanalysis.asp, line 42