[Solved] Filter subForm by date

Creating and using forms

[Solved] Filter subForm by date

Postby te4o93 » Fri Apr 29, 2016 1:04 am

hello everybody, i need help to filter a subForm by date parameter
it doesn't get any error but for every date i try to set it clears the subForm
this is what i'm trying to do
(my date format(italian) is DD/MM/YY)

Code: Select all   Expand viewCollapse view
   dim oFilter as object

   oForm = ThisComponent.DrawPage.Forms.getByIndex(0)
   oSubForm = oForm.GetByName("SubForm") 
   
   oSubForm.Filter = "'Date' >= '20/03/16'"
   oSubForm.ApplyFilter = True
   
   oSubForm.Reload
End Sub


Thanks
Last edited by Hagar Delest on Sat Apr 30, 2016 9:48 pm, edited 2 times in total.
Reason: tagged [Solved].
OpenOffice 4 on Windows 10
te4o93
 
Posts: 2
Joined: Fri Apr 29, 2016 12:51 am

Re: Filter suForm by date

Postby Villeroy » Fri Apr 29, 2016 2:39 pm

'20/03/16' is not a date.
'2016-03-20' is a date.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28573
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Filter suForm by date

Postby te4o93 » Fri Apr 29, 2016 11:40 pm

thanks i fixed it with this --> {d 'yyy-mm-dd'}
OpenOffice 4 on Windows 10
te4o93
 
Posts: 2
Joined: Fri Apr 29, 2016 12:51 am


Return to Forms

Who is online

Users browsing this forum: No registered users and 2 guests