locked
Date wise data retrieve from database. RRS feed

  • General discussion

  • Below is my data,i want to retrieve record from database on data filter of B_Date and D_Date at once.

    Create table #ItemMasterFile (item_ID int,item_Name varchar(50))
    Create table #Bigbalprd (B_ID int,item_ID int,B_QTY int,B_Weight int,B_Date date)
    Create table #DispatchBM (D_ID int,Name varchar(50),D_Date date)
    Create table #DispatchDB (ID int ,D_ID int,item_ID int,D_QTY int,D_Weight int)
    
    INSERT INTO #ItemMasterFile VALUES
      (1,'A')
    , (2,'B')
    , (3,'C')
    , (4,'D')
    , (5,'e')
    , (6,'f')
    , (7,'g')
    , (8,'h')
    , (9,'K')
    , (10,'L')
    , (11,'M');
    
    
    INSERT INTO #Bigbalprd VALUES
    (111,1,1,500,'03-06-2020')
    ,(112,2,1,200,'03-06-2020')
    ,(113,1,1,300,'03-06-2020')
    ,(114,6,1,100,'04-06-2020')
    ,(115,1,1,200,'04-06-2020')
    ,(116,1,1,300,'04-06-2020')
    ,(117,7,1,100,'05-06-2020')
    ,(118,5,1,200,'05-06-2020')
    ,(119,8,1,300,'06-06-2020')
    
    Insert into #DispatchBM Values
    (1001,'Akhter','03-06-2020')
    ,(1002,'Irfan','05-06-2020')
    Insert into #DispatchDB Values
    (11,1001,1,1,500)
    ,(12,1001,2,1,200)
    ,(13,1001,1,1,300)
    ,(14,1002,7,1,100)
    ,(15,1002,5,1,200)
    
    
    
    
    Output


    akhter

    • Changed type Akhterhussain Monday, July 27, 2020 7:00 AM wrong post type
    Thursday, July 16, 2020 11:54 AM