Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DCORTESR
New Member

SYSDATE minus other "DATE"

Hi, I have a connection to an Oracle database through Direct Query, I need to subtract a date type column from sysdate.

This can be directly from the query to Oracle or through Power BI.

 

I mean:

(SYSDATE) - (FECHA_FIN)

 

I share my query:Capture.JPG

 

 

Can anyone guide me?

 

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi DCORTESR,

You could try to use query like below 

SELECT TO_DATE('2000-01-02', 'YYYY-MM-DD') -  
       TO_DATE('2000-01-01', 'YYYY-MM-DD') AS DateDiff
FROM   dual

Or 

SELECT DATEDIFF(day,'2016-06-05','2016-08-05') AS DiffDate

in Oracle query

Or you could ry to create column or measure like below in powerbi

DATEDIFF([field1], [field2], day) 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
dax
Community Support
Community Support

Hi DCORTESR,

You could try to use query like below 

SELECT TO_DATE('2000-01-02', 'YYYY-MM-DD') -  
       TO_DATE('2000-01-01', 'YYYY-MM-DD') AS DateDiff
FROM   dual

Or 

SELECT DATEDIFF(day,'2016-06-05','2016-08-05') AS DiffDate

in Oracle query

Or you could ry to create column or measure like below in powerbi

DATEDIFF([field1], [field2], day) 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.