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 :
Power Automate - Building Flows
Answered

Dataverse Date Only Has Time, How to Query if Unknown?

(1) ShareShare
ReportReport
Posted on by 1,374 Moderator
I have a Dataverse table of vacation dates. The column that stores this is Date Only, yet in at least one instance that I am testing, it has a time value of 2024-05-31T04:00:00Z
 
How can I query the table to find that specific date, if I don't know what time value may be associated with it?
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    12,515 Super User 2025 Season 2 on at
    Dataverse Date Only Has Time, How to Query if Unknown?
    When you want to filter rows from a Dataverse table based on a date field while ignoring the time, you can use the ge (greater than or equal to) and le (less than or equal to) operators to specify a date range.
     
    Using ge and le together:
    • The filter 'createdon ge '@{formatDateTime(utcNow(),'yyyy-MM-dd')}' and createdon le '@{startOfDay(addDays(utcNow(),1),'yyyy-MM-dd')}'` checks if the `createdon` date is greater than or equal to the current date (ignoring the time) and less than or equal to the start of the next day (ignoring the time). By combining these two conditions, you effectively filter for rows where the `createdon` date is exactly today, ignoring the time component.
     
    Using only ge:
    • The filter `createdon ge '@{formatDateTime(utcNow(),'yyyy-MM-dd')}'` checks if the `createdon` date is greater than or equal to the current date (ignoring the time).
    When to use each approach:
    • Use `ge` and `le` together when you need to filter for rows within a specific date range, such as all rows created on a particular day.
    • Use only `ge` when you want to filter for rows created from a specific date onwards, including all times on that date.
    Example scenarios:
    1. Filtering for today's records: Use both `ge` and `le` to ensure you capture all records created today, regardless of the time.
    2. Filtering for records from today onwards: Use only `ge` to include all records created from today onwards, including future dates.

    Important note: be sure to format the expressions using the date format yyyy-MM-dd as this is the ISO8601 format. Using another date format will not work.
  • IPC_ahaas Profile Picture
    1,374 Moderator on at
    Dataverse Date Only Has Time, How to Query if Unknown?
    Thank you @David_MA (this used to work to tag people 🙄) I was able to get there using your code - specifically the "ge" and "le", but restricted to the specific date I'm looking for:
     
    ipc_vacationdate ge 'formatDateTime(outputs('Get_response_details')?['body/r39784a5e517241e4bcb6a11e392f00f0'],'yyyy-MM-ddT00:00:00Z')' and ipc_vacationdate le 'formatDateTime(outputs('Get_response_details')?['body/r39784a5e517241e4bcb6a11e392f00f0'],'yyyy-MM-ddT23:59:59Z')'
     
  • Suggested answer
    SaiRT14 Profile Picture
    1,988 Super User 2025 Season 2 on at
    Dataverse Date Only Has Time, How to Query if Unknown?
    Check following options:
    filter=year(vacation_date_column) eq 2024 and month(vacation_date_column) eq 5 and day(vacation_date_column) eq 31
     
    <fetch>
      <entity name="vacation_dates_table">
        <attribute name="vacation_date_column" />
        <filter>
          <condition attribute="vacation_date_column" operator="on" value="2024-05-31" />
        </filter>
      </entity>
    </fetch>
     
     
     

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…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard