I have used  the commands to keep Csr.Getstring("Guest") as variable.
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
and then I used other command
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Why it has error? How do I code? I would like to get TotalCostPaid from the same guest who rents many rooms.
			
			
			
				B4X:
			
		
		
		Csr = SQL1.ExecQuery("SELECT ID,Guest FROM RentTable")
Csr.Position = row
			
				B4X:
			
		
		
		Dim TotalCostPaid As String=SQL1.ExecQuerySingleResult("SELECT sum(CostPaid) FROM RentTable WHERE Guest=Csr.Getstring("Guest")")Why it has error? How do I code? I would like to get TotalCostPaid from the same guest who rents many rooms.
 
				 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		