$att="select AttData.Rollno,AttData.Name,AttData.Year,AttData.sec,
AttData.".$date."
from AttData where AttData.sec='".$sec."'
and AttData.dept='".$dept."'
and AttData.year='".$year."' and AttData.".$date."='AB' ";
I am trying to select absents data from AttData table with dynamic column value as date variable .
But i am getting following error :
Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Invalid use of '.', '!', or '()'. in query expression 'AttData.'02-07-2016'., SQL state 37000 in SQLExecDirect in C:\xampp\htdocs\sms\repotdaygen_allyear.php on line 325 select invalid37000
Please help me what is the error.
date_column_namefrom the table instead of value$date- jitendrapurohit