web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Date format for from and to date fetchxml

(0) ShareShare
ReportReport
Posted on by

Hello Guys,

I want to fetch records based and from and to date below is my fetchxml i want to use this format ddmmyyyy rather than yyyymmdd please help 

<fetch mapping="logical" version="1.0" >
<entity name="hd_logmanager" >
<attribute name="hd_logmercod" alias="MerchantCode" />
<attribute name="hd_loguserid" alias="MemberCode" />
<order attribute="hd_logdattim" />
<filter>
<condition attribute="hd_logmercod" operator="eq" value="INTER09716" />
</filter>
<filter>
<condition attribute="hd_logdattim" operator="on-or-before" value="2016-09-03" />

<condition attribute="hd_logdattim" operator="on-or-after" value="2016-09-07" />
</filter>
</entity>
</fetch>

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at
    RE: Date format for from and to date fetchxml

    Hi,

    I don't think you can change the format. What's the problem you're trying to get around?

    Thanks,

     Aiden

  • Community Member Profile Picture
    on at
    RE: Date format for from and to date fetchxml

    i want to use shortdate  i am confused i donno much about date formats in crm

  • Aiden Kaskela Profile Picture
    19,696 on at
    RE: Date format for from and to date fetchxml

    Why do you need to use the one format instead of the other? Is it just preference or is there a business need pushing you to use 'dd-mm-yyyy' ?

  • Suggested answer
    Saroj Das Profile Picture
    3,355 on at
    RE: Date format for from and to date fetchxml

    Follow the below steps to achieve this.

    Take 4 parameters

    startdate (Date Time type) 

    enddate (Date Time type)

    startdatevalue (string) (hidden) --> set default value =Format(Parameters!startdate.Value, "yyyy-MM-dd")

    enddatevalue (string) (hidden) --> set default value =Format(Parameters!enddate.Value, "yyyy-MM-dd")

    reportparam.JPG

    <fetch mapping="logical" version="1.0" >
    <entity name="hd_logmanager" >
    <attribute name="hd_logmercod" alias="MerchantCode" />
    <attribute name="hd_loguserid" alias="MemberCode" />
    <order attribute="hd_logdattim" />
    <filter>
    <condition attribute="hd_logmercod" operator="eq" value="INTER09716" />
    </filter>
    <filter>
    <condition attribute="hd_logdattim" operator="on-or-before" value="@startdatevalue" />

    <condition attribute="hd_logdattim" operator="on-or-after" value=""@enddatevalue"" />
    </filter>
    </entity>
    </fetch>

    Thanks,
    Saroj

  • Community Member Profile Picture
    on at
    RE: Date format for from and to date fetchxml

    its a business need

  • Saroj Das Profile Picture
    3,355 on at
    RE: Date format for from and to date fetchxml

    The solution i have given is internally it will use the yyyy-MM-dd format to fetch the record in fetch xml but it will show the report result in dd/mm/yyyy format. The  date format in your local machine should be in dd/mm/yyyy format. when you select your date range, it should be in dd/mm/yyyy format.

    Thanks,

    Saroj

  • Aiden Kaskela Profile Picture
    19,696 on at
    RE: Date format for from and to date fetchxml

    Saroj,

    Muhammed never said he's trying to write SSRS reports using Fetch - your solution may work but he hasn't given any context about how this is being used. That's what I'm trying to find out.

    Aiden

  • Community Member Profile Picture
    on at
    RE: Date format for from and to date fetchxml

    i have a wcf service the app will send date in dd-mm-yyyy format i am using Datatype datetime for from and todate and behaviour local and my local machine format is also dd-mm-yyyy bt still when i try to send value by dd-mm-yyyy it does not return any records

    localhost/.../getErrorLog;value2=2016-09-08

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans