Guest User

Guest User

  • Tech Writer
  • 611
  • 126.4k

Search Record from database in sql store procedure.

Jun 20 2020 8:15 AM
How to search record by date in sql stored procedure sql stored procedure.
 
ALTER Procedure [HMAMHUser].[sp_SrchPaymentsHistory]
(
@OrderDate datetime
)
 
select U.UserImage,U.FirstName,O.TransactionId,O.OrderDate,OT.TotalPriceAfterVAT
from OrderMaster as O
inner join UserProfileDetail U on U.UserId=O.UserId
inner join tblOrderDetail OT on OT.OrderId=O.OrderId
where OrderDate LIKE '%' +Convert(nvarchar(25),@OrderDate) + '%'
End
it's me code storeprocdure .
 

exec [sp_SrchPaymentsHistory] @OrderDate="2020-06-05 07:14:36.157 "- it's run successfully 
 
But i want to this -
exec [sp_SrchPaymentsHistory] @OrderDate="06" .I have type only date not full datetime .
 
please provide solution. 
 
  
 

Answers (2)