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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / datetime filter on Ora...
Power Automate
Suggested Answer

datetime filter on Oracle data

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I am building a flow where I am trying to get rows from a Oracle database table. I am trying to take last 30 days data by filtering a date column in the table. But I keep getting below error no matter what operator I use. It is working only for 'eq' operator, but any other operator like 'ge' throws the same error with < symbol.

 

I searched through forums and looks like many people faced this issue with date fields. Some workaround suggest to create new number field in table to store the date. Is there any other work around without altering the table structure in database?

 

{
  "status"400,
  "message""We cannot apply operator < to types DateTimeZone and DateTime.\r\n     inner exception: We cannot apply operator < to types DateTimeZone and DateTime.\r\nclientRequestId: 7d833c5e-64fd-4c63-8789-a38a4c81a1d9",
  "source""oracle-eus.azconn-eus.p.azurewebsites.net"
}

 

Flow and the error screenshot is provided below,

 

Flow1.JPGOutput1.JPGOutput2.JPG

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Thanks for sharing the detailed information.

     

    Could you try to use the following code on your side to see if it will work?

    1.PNG2.PNG

     

    Doc on Odata filter query for reference:

    https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)

     

     

     

    Best regards,

    Mabel Mao

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-yamao-msft,

     

    I saw this workaround as well in previous posts, but this will not help always. Eg. if we run this in January 2019, I think it will fail since the month of UTCNOW will return 01, but the actual date in the condition will return 09 and hence it will fail. I am trying to take past 8 hours data from a table, but if I use hour it will fail for previous day 11 PM records since that will be higher than the current time when run in morning.

     

    Is there a simple way to take this data? Oracle do not have Date and Datetime datatype separately and I dont see any way to take past 8 hours data, I thought it will be simple when I started.

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-yamao-msft,

     

    Upon further checking the above issue, if direct condition cannot be used I thought converting it to the format YYYYMMDDHHMI should work with greater than condition irrespective of when it is run. So I tried this as shown in screenshot below, but the concatenation failed saying it cannot concatenate two numbers. I tried to convert it, but the String function is not getting recognized when used there. I am trying to achiever something like below formula, but not sure how to use the conversion function along with Oracle column. (Note: for simple understanding of concept, I am using only year and month for now and used direct value on right side instead of UTCNOW function)

     

    Value(Concat(String(year(X_CREATION_TIME)), String(month(X_CREATION_TIME)))) ge 201809

     

    Flow2.JPG

  • grazzhopper Profile Picture
    36 on at

    Hi @Anonymous,

     

    Did you eventually solve it?

     

    As I have the same issues with the Oracle connector and seem to be unable to query a table with a DATE type field (INSUPDTIMESTAMP) formatted '2018-10-30 14:22:31' in an Oracle table and retrieve only records that are greater then for example utcNow().

     

    Rather annoying.

     

    Even the suggested workaround method with querying like undermentioned does not give the right results.

    BOOKING ne null and year(INSUPDTIMESTAMP) ge year(@{outputs('Opstellen')}) and month(INSUPDTIMESTAMP) ge month(@{outputs('Opstellen')}) and day(INSUPDTIMESTAMP) ge day(@{outputs('Opstellen')}) and hour(INSUPDTIMESTAMP) ge hour(@{outputs('Opstellen')}) and minute(INSUPDTIMESTAMP) ge minute(@{outputs('Opstellen')}) and second(INSUPDTIMESTAMP) ge second(@{outputs('Opstellen')})

     

    If you've found a solution I'd appreciate it! Otherwise @v-yamao-msft, perhaps this will be developped for the Oracle connector soon?

     

    Love to hear you guys,

    grtz,

    grazz.

  • Community Power Platform Member Profile Picture
    on at

    @grazzhopper,

     

    No, it did not work for me as well properly. Hopefully they will have a solution for this soon.

  • grazzhopper Profile Picture
    36 on at

    Hi, @Anonymous

     

    Indeed.

     

    Perhaps as a quick-and-dirty help in the meantime and how I worked around it: I'm having our database engineers add a trigger to the tables I need regular updates from. The changedatetime will be stored as an Integer in the form of [yyyyMMddHHmmss]. So 2018-11-16 15:15:22 will be 20181116151522 with an index on it. No the most elegant of solutions and you hav to take care of timezones yourself without a proper timestamp, but it gives the desired result I needed.

     

    I can query the tables now with a simple odata filter [UPDATETIMESTAMP ge 20181116151522] and get the records on that timestamp and later with teh Oracle Connector.

     

    Perhaps you can take advantage of this method also, you never know; but the best thing will be that it will be facilitaited properly withing teh premium connector. 😉

     

    Have a good weekend!

    grtz,

    grazz.

  • KalebDell Profile Picture
    4 on at

    Anyone revisited this since?

    Still having the issue. Weird that "Filter by date" isn't listed under "known bugs" on the connector's info page (https://docs.microsoft.com/en-us/connectors/oracle/) but seems a pretty big miss of basic SQL functionality*

    *yes, something is better than nothing. But still. 

  • Suggested answer
    CU23070619-3 Profile Picture
    2 on at
    Hey, I found solution.
    In filter Query put date like this Contains(YourDateColumn ,'30-MAR-27')
    You will get response in "standard" type - 2027-03-30T00:00:00Z

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard