A Database Error Occurred Error Number: 42000/102

now i'm developing a web app using php framework CodeIgniter.

My web uses a SQL Server 2008 database connection (sqlsrv). I want to use sql query like this:

SELECT *
FROM (SELECT *, ROW_NUMBER () OVER (ORDER BY No Progress) as line
      FROM MASTER_IMP
     ) a
WHERE line> = $ limit and line <= $ offset

then I put the query in my CI model when i run it, an error appears like this:

===========================================================

A Database Error Occurred

Error Number: 42000/102

[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near '='.

SELECT *
FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY NoPengajuan) as baris
      FROM MASTER_IMP
     ) a
WHERE baris >= 10 and baris <=

Filename: C:/xampp/htdocs/ci-indoasia/system/database/DB_driver.php

Line Number: 691

===========================================================

here is my mvc

my model:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Model_MASTER_IMP extends CI_Model
{
	function data($limit,$offset){ //$limit yaitu urutan record yg mulai pertama ditampilkan, $offset yaitu jumlah record yg akan ditampilkan
		$kueri = $this->load->database('sqlserver', TRUE);
		return $kueri->query
		("SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (ORDER BY NoPengajuan) as baris FROM MASTER_IMP ) a WHERE baris >= $limit and baris <= $offset")->result();		
	}
 
	function jumlah_data(){
		return $this->db->get('MASTER_IMP')->num_rows();
	}
}	

my controller:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Server1_IMPORT_STATISTIC extends CI_Controller
{	
	function __construct()
	{
		parent::__construct();
		$this->load->helper(array('url'));
		$this->load->model('server1/IMPORT_STATISTIC/model_MASTER_IMP');
	}
	
	public function MASTER_IMP()
	{
		$this->load->database();
		$jumlah_data = $this->model_MASTER_IMP->jumlah_data();
		$this->load->library('pagination');
		$config['base_url'] = base_url().'server1/IMPORT_STATISTIC/MASTER_IMP';
		$config['total_rows'] = $jumlah_data;
		$config['per_page'] = 10;
		
		$config['first_link']       = 'Pertama';
        $config['last_link']        = 'Terakhir';
        $config['next_link']        = 'Berikut';
        $config['prev_link']        = 'Sebelum';
        $config['full_tag_open']    = '<div class="pagging text-center"><nav><ul class="pagination justify-content-center">';
        $config['full_tag_close']   = '</ul></nav></div>';
        $config['num_tag_open']     = '<li class="page-item"><span class="page-link">';
        $config['num_tag_close']    = '</span></li>';
        $config['cur_tag_open']     = '<li class="page-item active"><span class="page-link">';
        $config['cur_tag_close']    = '<span class="sr-only">(current)</span></span></li>';
        $config['next_tag_open']    = '<li class="page-item"><span class="page-link">';
        $config['next_tagl_close']  = '<span aria-hidden="true">&raquo;</span></span></li>';
        $config['prev_tag_open']    = '<li class="page-item"><span class="page-link">';
        $config['prev_tagl_close']  = '</span>Next</li>';
        $config['first_tag_open']   = '<li class="page-item"><span class="page-link">';
        $config['first_tagl_close'] = '</span></li>';
        $config['last_tag_open']    = '<li class="page-item"><span class="page-link">';
        $config['last_tagl_close']  = '</span></li>';
		
		$from = $this->uri->segment(3);
		$this->pagination->initialize($config);		
		$data['MASTER_IMP'] = $this->model_MASTER_IMP->data($config['per_page'],$from);
		$this->load->view('server1/IMPORT_STATISTIC/MASTER_IMP', $data);
	}
		//$kueri = $this->load->database('sqlserver', TRUE);
		//var_dump($kueri->query("select top 5 * from MASTER_IMP order by NoPengajuan;")->result_array());
}

my view:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>Indo Asia | Database IMPORT STATISTIC</title>
			<?php include 'application/views/komponen/header.php'; //meta, css, js ?>
	</head>
<body>
	<?php include 'application/views/komponen/navbar.php'; //navbar ?>

<div class="container text-center">    
	<div class="row content">
		<div class="col-sm-12 text-left"> 
			<div class="panel panel-default">
				<div class="panel-heading">
					<h2>Database IMPORT STATISTIC</h2>
				</div>
				<div class="panel-body">
					<div class="table-responsive">
						<table class="table table-hover table-bordered">
							<tr>
								<th>No</th>
								<th>NoPengajuan</th>
								<th>TanggalPIB</th>
								<th>TanggalBLAWB</th>
								<th>PelabuhanAsal</th>
								<th>PelabuhanTujuan</th>
								<th>Importir</th>
								<th>AlamatImportir</th>
								<th>PPJK</th>
								<th>AlamatPPJK</th>
								<th>Pemasok</th>
								<th>AlamatPemasok</th>
								<th>NegaraPemasok</th>
								<th>HS</th>
								<th>UraianBarang</th>
								<th>Quantity</th>
								<th>KodeSatuan</th>
								<th>Berat</th>
								<th>HargaCIF</th>
								<th>MataUang</th>
								<th>NPWP</th>
							</tr>
							<?php 
							$no = $this->uri->segment('3') + 1;
							foreach($MASTER_IMP as $baris){ 
							?>
							<tr style="white-space:nowrap">
								<td align="right"><?php echo number_format($no++, 0, ',', '.') ?></td>
								<td><?php echo $baris->NoPengajuan ?></td>
								<td><?php echo $baris->TanggalPIB ?></td>
								<td><?php echo $baris->TanggalBLAWB ?></td>
								<td><?php echo $baris->PelabuhanAsal ?></td>
								<td><?php echo $baris->PelabuhanTujuan ?></td>
								<td><?php echo $baris->Importir ?></td>
								<td><?php echo $baris->AlamatImportir ?></td>
								<td><?php echo $baris->PPJK ?></td>
								<td><?php echo $baris->AlamatPPJK ?></td>
								<td><?php echo $baris->Pemasok ?></td>
								<td><?php echo $baris->AlamatPemasok ?></td>
								<td><?php echo $baris->NegaraPemasok ?></td>
								<td><?php echo $baris->HS ?></td>
								<td><?php echo $baris->UraianBarang ?></td>
								<td><?php echo $baris->Quantity ?></td>
								<td><?php echo $baris->KodeSatuan ?></td>
								<td><?php echo $baris->Berat ?></td>
								<td><?php echo $baris->HargaCIF ?></td>
								<td><?php echo $baris->MataUang ?></td>
								<td><?php echo $baris->NPWP ?></td>
							</tr>
							<?php } ?>
						</table>
					</div>
					<?php 
					echo $this->db->count_all_results('MASTER_IMP').' record(s) ditampilkan'; 
					echo $this->pagination->create_links();
					?>
				</div>
			</div>
		</div>
	</div>
</div>

	<?php include 'application/views/komponen/footer.php'; //footer ?>
</body>
</html>

query reference: https://blogs.msdn.microsoft.com/sqlserver/2006/10/25/limit-in-sql-server/

please help where is the query error?

thank you