Hello,
I have one query,

$sql_query = db_select('Int_schedule_Table', 'c'); //name given as **c**


$sql_query->fields('c',array('Int_Schedule_Id', 'cand_id', 'Int_Panel_Id', 'Interview_Date', 'Interview_Time','Interview_feedback_status', 'Interview_for_vacancy',  'hr_name', 'Int_Type')); //took fields from C

$sql_query = $sql_query->extend('TableSort')->extend('PagerDefault')->limit(20); // I fired qury here 

$result = $sql_query->orderByHeader($header)->execute(); // after this I have simply applied my logic of displaying fields on $result.

But my question is how can I apply "WHERE" condition on this query?
like WHERE Interview_Date < $today_date.

Please dont tell me to change query stucture since I have used this all over.

or is there any way for:
I have an array $rows[], which contains 'Int_Schedule_Id', 'cand_id', 'Int_Panel_Id', 'Interview_Date', 'Interview_Time','Interview_feedback_status', 'Interview_for_vacancy', 'hr_name', 'Int_Type'.

can I again take data of this array in which 'Interview_Date' is greater than $DATE ?

What API do you use?

Hello,
Am using this in Drupal.
So any idea for Drupal?

hello guys,
I got solution for this.
I had to just write that query as

$sql_query -> condition('Interview_Date', $today_date , '>=')

where $today_date is a date you want to compare with.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.