0

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.

Edited by Dani: Formatting fixed

2
Contributors
5
Replies
22
Views
4 Years
Discussion Span
Last Post by Priti_P
0

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 ?

0

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

0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.