none
Someone can provide help by Translating from SQL -> LinQ RRS feed

  • Question

  • Hey
    I do know, that this is a bigger code, but I can't get him working. - And maybe out there is someone how has the knowledge to take a look....


    So, my SQL Code is as follows:

    SELECT       
    iprolenstype.bezeichnung, iprolenstype.standard_marke, iprolenstype. ` ein_mehrstärken `, iprolenstype.phototrop, iprolenstype.manufacturer_code, iprolenstype.material, iprolensrange.hst_code_grundglas AS hst_code_grundglas
    FROM           
    iprolensrange iprolensrange
    INNER JOIN
    iprolenstype iprolenstype ON iprolensrange.hst_code_grundglas = iprolenstype.hst_code_grundglas
    WHERE       
    (: HSRe * iprolensrange.cyl_shs_von / 100 + : HSRe BETWEEN iprolensrange.shs_von / 100 AND iprolensrange.shs_bis / 100) AND
    (: HSRe * iprolensrange.cyl_shs_bis / 100 + : HSRe BETWEEN iprolensrange.shs_von / 100 AND iprolensrange.shs_bis / 100) AND
    (: cylRe BETWEEN iprolensrange.cyl_von / 100 AND iprolensrange.cyl_bis / 100) AND (: HSLi * iprolensrange.cyl_shs_von / 100 + : HSLi BETWEEN iprolensrange.shs_von / 100 AND iprolensrange.shs_bis / 100) AND
    (: HSLi * iprolensrange.cyl_shs_bis / 100 + : HSLi BETWEEN iprolensrange.shs_von / 100 AND iprolensrange.shs_bis / 100) AND
    (: cylLi BETWEEN iprolensrange.cyl_von / 100 AND iprolensrange.cyl_bis / 100) AND 
     (CURDATE() BETWEEN IfNull(iprolenstype.lieferbar_ab, CurDate()) AND IfNull(iprolenstype.lieferbar_bis, CurDate()))
    GROUP BY iprolenstype. ` ein_mehrstärken `, iprolensrange.hst_code_grundglas
    ORDER BY iprolenstype.standard_marke, iprolensrange.hst_code_grundglas, iprolenstype. ` ein_mehrstärken `

    My result LinQ (Which is not working correct)

    Dim
    Glaeser = From Range In GetDataContext.iprolensrange _
    Join Type In GetDataContext.iprolenstype _
    On Range.hst_code_grundglas Equals Type.hst_code_grundglas Where _
    ((HSRe * Range.cyl_shs_von / 100 + HSRe) >= (Range.shs_von / 100)
    AndAlso _
    (HSRe * Range.cyl_shs_von / 100 + HSRe) <= (Range.shs_bis / 100)
    And _
    (HSRe * Range.cyl_shs_bis / 100 + HSRe) >= (Range.shs_von / 100)
    AndAlso _
    (HSRe * Range.cyl_shs_bis / 100 + HSRe) <= (Range.shs_bis / 100)
    And _
    cylRe >= (Range.cyl_von / 100)
    AndAlso cylRe <= (Range.cyl_bis / 100)) And _
    ((HSLi * Range.cyl_shs_von / 100 + HSLi) >= (Range.shs_von / 100)
    AndAlso _
    (HSLi * Range.cyl_shs_von / 100 + HSLi) <= (Range.shs_bis / 100)
    And _
    (HSLi * Range.cyl_shs_bis / 100 + HSLi) >= (Range.shs_von / 100)
    AndAlso _
    (HSLi * Range.cyl_shs_bis / 100 + HSLi) <= (Range.shs_bis / 100)
    And _
    cylli >= (Range.cyl_von / 100)
    AndAlso cylli <= (Range.cyl_bis / 100)) And _
    Now >=
    If(Type.lieferbar_ab Is Nothing, Now, Type.lieferbar_ab) AndAlso _
    Now <=
    If(Type.lieferbar_bis Is Nothing, Now, Type.lieferbar_bis) _
    Group By Key = New With {Type.ein_mehrstrken, Type.hst_code_grundglas} _
    Into Group Order By Key.hst_code_grundglas, Key.ein_mehrstrken _
    Select New With {.Versuch = From GetBack In Group Select _
    GetBack.Type.bezeichnung, GetBack.Type.standard_marke, _
    GetBack.Type.ein_mehrstrken, GetBack.Type.phototrop, _
    GetBack.Type.manufacturer_code, GetBack.Type.material, _
    GetBack.Range.hst_code_grundglas}

    Wednesday, March 18, 2009 2:00 PM