This very code supposed to fetch credits and deposits when customer phone number is searched, but the search is not working, when i click the button search without inserting any number records will still show am i missing something?
The SQL Procedure is not selecting the right record, the select query supposed to check if the user’s phone number has any credit or deposit if yes then this credit and deposit record should be selected.
Stored ProceduresSET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GetCustomerREPORTS]
@Phone NVARCHAR(100)
AS
SELECT * FROM ItemOrdered
WHERE [Status]='Credit' OR [Status]='Deposit' AND Phone=@Phone
ORDER BY Date_Sold DESC
RETURN 0