CodeIgniter Forums
sql NOT BETWEEN operator - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: sql NOT BETWEEN operator (/showthread.php?tid=60595)



sql NOT BETWEEN operator - El Forum - 05-03-2014

[eluser]fnbhns[/eluser]
Hi.. All.

I am new in Codeigniter, I need your kind support for the NOT BETWEEN operator sql code. I know the BTWEEN,

BETWEEN
Code:
->where('pickup_date >=',$sess['pickup_date'] )
->where('pickup_date <=',$sess['return_date'] )

But now i need the NOT BETWEEN, Need your help, if you show me any example code and looking forward. Thank you in Advance.


sql NOT BETWEEN operator - El Forum - 05-03-2014

[eluser]CroNiX[/eluser]
See the manual for db::where()
http://ellislab.com/codeigniter/user-guide/database/active_record.html
Code:
->where('pickup_date NOT BETWEEN ' . $sess['pickup_date'] . ' AND ' . $sess['return_date'], NULL, FALSE)



sql NOT BETWEEN operator - El Forum - 05-03-2014

[eluser]fnbhns[/eluser]
Hi.. CroNiX

Thank you so much for your so quick support. Its really became so helpful.

But the DATE should be in single quotation ( ' ') that is (NOT BETWEEN ' 2014/05/06 06:00 ')
How can i put this single quotation here please. Sorry for such a quesiton.

Thank you once again for your support.


sql NOT BETWEEN operator - El Forum - 05-03-2014

[eluser]fnbhns[/eluser]
Hi.. CroNiX

I already solved the problem. Thank you so much, for your help i done so quickly.
Code:
->where('pickup_date NOT BETWEEN "' .$sess['pickup_date'] . '" AND "' . $sess['return_date'].'"',NULL, FALSE)