Hi,

I want to show all months of a year in a combobox and if I choose one month then it shows only the records of that month in a table. It is an webapplication

How can I do this?

There are many ways that could fit into your description.


If you want to choose the months only available in your table i would create an aggregate or a SQL.

The aggregate would have an expression: formatdatetime(datefield, "yyyyMM")

and i would do a group by on that field.


The table you will do the filter must also contain that same field/expression.


If its really a large table this will be bad for performance. You could create a list instead.


So: could you be littlebit more specific.

Stefano Valente wrote:

There are many ways that could fit into your description.


If you want to choose the months only available in your table i would create an aggregate or a SQL.

The aggregate would have an expression: formatdatetime(datefield, "yyyyMM")

and i would do a group by on that field.


The table you will do the filter must also contain that same field/expression.


If its really a large table this will be bad for performance. You could create a list instead.


So: could you be littlebit more specific.

Hi Stefano,

I am making a Timetracking application and I want to filter on months. But first of all I need to show the months in an Dropdown if I know how that works I can solve the rest by myself. If I choose by example September then I want to show the user thats logged in his workhours for that month. I think for the good looking I want to show it in a table. 

Stefano Valente wrote:

There are many ways that could fit into your description.


If you want to choose the months only available in your table i would create an aggregate or a SQL.

The aggregate would have an expression: formatdatetime(datefield, "yyyyMM")

and i would do a group by on that field.


The table you will do the filter must also contain that same field/expression.


If its really a large table this will be bad for performance. You could create a list instead.


So: could you be littlebit more specific.

Hi Stefano,

I forget to tell one more thing I dont want to choose only the months in my table but all the months in a year. 


If you want to have a list of months then just create a list. Note that you will have difficulties when your application data contains 2 years and you will have data of the same month but different years.

To create the list you can make a server action GetMonthList and set as output a list of records with an integer and text attribute. 


Is this helpfull or do you need more help creating that Server action?

Halit,

Can you attach the oml? 

I will try to create a sample code in it.

Stefano Valente wrote:

There are many ways that could fit into your description.


If you want to choose the months only available in your table i would create an aggregate or a SQL.

The aggregate would have an expression: formatdatetime(datefield, "yyyyMM")

and i would do a group by on that field.


The table you will do the filter must also contain that same field/expression.


If its really a large table this will be bad for performance. You could create a list instead.


So: could you be littlebit more specific.

Hi Stefano,

I forget to tell one more thing I dont want to choose only the months in my table but all the months in a year. 


Stefano Valente wrote:

Halit,

Can you attach the oml? 

I will try to create a sample code in it.

I want to use a combobox for the months if I make a local variable with data type Date I get an error because the combobox expect a variable with identifier how can I solve it 

Stefano Valente wrote:

If you want to have a list of months then just create a list. Note that you will have difficulties when your application data contains 2 years and you will have data of the same month but different years.

To create the list you can make a server action GetMonthList and set as output a list of records with an integer and text attribute. 


Is this helpfull or do you need more help creating that Server action?

You tell me just make an list but what do I need to list from where can I get the months of a year that is what I dont understand

Solution

Check the oml. Is this what you need?

Solution

Stefano Valente wrote:

Check the oml. Is this what you need?

Thank you very much!