Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XQuery - How to get 90 days before date from a given date?

Tags:

xquery

In xquery, How to get 90 days before date from a given date?

Say given date is 30-03-2012. I want to get the date which is 90 days before the given date. Leap year calculation should also not get missed.

I could not find any built in functions. There are add/substract methods, but it works only with two dates.

Any ideas?

like image 564
Radhika Avatar asked Mar 29 '12 20:03

Radhika


1 Answers

You need to subtract a dayTimeDuration (90 days) from a date, i.e.

xs:date("2012-03-30") - xs:dayTimeDuration("P90D")
like image 133
Gunther Avatar answered Jan 04 '23 06:01

Gunther