MANEESH AN

MANEESH AN

  • NA
  • 110
  • 46.9k

HOW TO GET DATA WITHIN THE FROM DATE AND TO DATE?

Jul 16 2013 4:21 AM
ALTER PROCEDURE [dbo].[sp_PaymentRegisterGrid]
(
  @DTFROM datetime, 
  @DTTO datetime
)
AS
BEGIN

SELECT     
ACC.dRPDate DATE,                
ACC.cVType TYPE,        
TS.vSeries SERIES,    
    
ACC.iRPNo VOUCHERNO,         
ACM.vAcName HEAD,        
ACC.vNarration NARRATION,        
ACC.deDRAmount DEBIT,        
ACC.deCRAmount CREDIT        
         
FROM tbl_Acc_Voucher AS ACC INNER JOIN         
tblSerialNumbers AS TS ON ACC.iSeriesId = TS.iSeriesId INNER JOIN         
tbl_Acc_AccountMaster AS ACM ON ACM.iAcID = ACC.iAcID

where dRPDate >=@DTFROM and dRPDate<=@DTTO

END





DLL

    public DataTable fnPayRegDateView(string strWhereCondition)
        {
            Connection objCon = new Connection();
            SqlParameter[] parmsDetails = new SqlParameter[1];

            parmsDetails[0] = new SqlParameter();
            parmsDetails[0].SqlDbType = SqlDbType.VarChar;
            parmsDetails[0].Value = strWhereCondition;
            parmsDetails[0].ParameterName = "@WhereCondition";
            DataTable dt = new DataTable();
            dt = objCon.fnSelectData("sp_PaymentRegisterGridView", parmsDetails);
            return dt;

        }


Answers (5)