locked
how to Convert folowed Sql Query to Fetch Xml Query RRS feed

  • Question

  • declare @fromdate datetime, @todate datetime
    select col2, col3
    from table1
    where (col1=string(uniqidentifier)) and
    (coldate >= @fromdate or @fromdate is null) and 
    (coldate <= @todate or @todate is null)
    Wednesday, December 3, 2014 8:55 AM

All replies

  • Hi,

    You can use advance find to generate fetch xml based on your queries.There is a button download fetchxml available in the advanced find window

    Thanks,

    Seban


    Wednesday, December 3, 2014 9:15 AM
  • How do you intend to use the FetchXml ? This will determine how the parameters are passed, and how you handle nulls in the parameters.

    As recommended by the previous post, a good starting point would be to create the query in Advanced Find (using specific values for @fromdate and @todate ) and to download the generated Xml


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Wednesday, December 3, 2014 10:12 AM
    Moderator