Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. doubt in cross join

doubt in cross join

Scheduled Pinned Locked Moved Database
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deepthy p m 0
    wrote on last edited by
    #1

    I use the following code to ruturn value SELECT Tbl_BuildingAggrement.*, Tbl_Building.*, Tbl_BuildCustomer.*, Tbl_Rent_Receipts.*, Tbl_Temple_Registration.* FROM Tbl_BuildingAggrement INNER JOIN Tbl_Building ON Tbl_BuildingAggrement.BL_Building_Id = Tbl_Building.Build_Id INNER JOIN Tbl_BuildCustomer ON Tbl_BuildingAggrement.BL_Cust_Id = Tbl_BuildCustomer.BuCust_Id FULL OUTER JOIN Tbl_Rent_Receipts ON Tbl_BuildingAggrement.BL_Id = Tbl_Rent_Receipts.RntAggId CROSS JOIN Tbl_Temple_Registration WHERE Tbl_BuildingAggrement.BL_Building_Id =1 AND Tbl_BuildingAggrement.BL_AggDate between CONVERT(DATETIME, '22/Mar/2009', 102) and CONVERT(DATETIME, '22/Nov/2008', 102) It display null value ,but i want to display Tbl_Temple_Registration details. that i used in this cross join. But it didn't display values .What the Solution for this .If cross join return values .

    M 1 Reply Last reply
    0
    • D deepthy p m 0

      I use the following code to ruturn value SELECT Tbl_BuildingAggrement.*, Tbl_Building.*, Tbl_BuildCustomer.*, Tbl_Rent_Receipts.*, Tbl_Temple_Registration.* FROM Tbl_BuildingAggrement INNER JOIN Tbl_Building ON Tbl_BuildingAggrement.BL_Building_Id = Tbl_Building.Build_Id INNER JOIN Tbl_BuildCustomer ON Tbl_BuildingAggrement.BL_Cust_Id = Tbl_BuildCustomer.BuCust_Id FULL OUTER JOIN Tbl_Rent_Receipts ON Tbl_BuildingAggrement.BL_Id = Tbl_Rent_Receipts.RntAggId CROSS JOIN Tbl_Temple_Registration WHERE Tbl_BuildingAggrement.BL_Building_Id =1 AND Tbl_BuildingAggrement.BL_AggDate between CONVERT(DATETIME, '22/Mar/2009', 102) and CONVERT(DATETIME, '22/Nov/2008', 102) It display null value ,but i want to display Tbl_Temple_Registration details. that i used in this cross join. But it didn't display values .What the Solution for this .If cross join return values .

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      I seriously think you need to use an inner join. Do some reading on join types. If you split the selects do they both return results! If query 1 return 3 records and query 2 return 5 records you will have 15 records in your result set. You do not need to convert your dates to string to do the filtering, this will work Tbl_BuildingAggrement.BL_AggDate between '22/Mar/2009' and '22/Nov/2008'

      Never underestimate the power of human stupidity RAH

      D 1 Reply Last reply
      0
      • M Mycroft Holmes

        I seriously think you need to use an inner join. Do some reading on join types. If you split the selects do they both return results! If query 1 return 3 records and query 2 return 5 records you will have 15 records in your result set. You do not need to convert your dates to string to do the filtering, this will work Tbl_BuildingAggrement.BL_AggDate between '22/Mar/2009' and '22/Nov/2008'

        Never underestimate the power of human stupidity RAH

        D Offline
        D Offline
        deepthy p m 0
        wrote on last edited by
        #3

        My question is when i use cross join it will return value or not? All other tables other than cross join when i apply condition it will not return value .In cross join table i need to truen that values bcs it contain comapny details.I think u can understand my problem.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups