From DateTime to Date in XQuery

Hugo Hendriks's picture

When you create a database adapter using JDeveloper, the Date fields in the database will be modelled as DateTime fields in the xsd. Often you will only want Date fields.

A simple way to convert the DateTime fields to Date fields using XQuery is like this:

  1. <ns3:Geboortedatum>{ data(xs:date(substring-before($pollSfStudentoplCollection1/ns4:PollSfStudentopl[1]/ns4:geboortedatum/text(),'T'))) }</ns3:Geboortedatum>