I want to set group by Date (DAY OF THE MONTH) in view, default openerp takes group by month, I don't want to do such code to add new char type field and then perform group by on that field.
Is there any pure solution for that ? Is there any feature in openerp that I missed.
Thanks in advance.
Related
I've been at this one a while.
Objective: Pivot a monthly summary of days worked by Resource within the range for that Resource line where those dates (from StartDate to EndDate) correspond to the Dates table IsWorkday field.
Thanks for your help!
It depends on how you define what a workday is. I suspect this is Monday thru Friday? If so, try the weekday function.
=WEEKDAY(serial_number,2)
Where serial_number is the cell with a date you want to identify. This would not exclude holidays, I would recommend an index/match on some holiday reference table for that.
https://support.office.com/en-us/article/WEEKDAY-function-60e44483-2ed1-439f-8bd0-e404c190949a
My table has a timestamp field, which is a standard RethinkDB date field.
Can I group rows by day / week / month using this timestamp field? Couldn't find any examples in the group() docs.
To group by month, day, or day of week individually:
r.table(...).group(r.row('timestamp').month())
r.table(...).group(r.row('timestamp').day())
r.table(...).group(r.row('timestamp').dayOfWeek())
Grouping by the week isn't as easy at the moment, because ReQL is currently missing a function to get the week number from a data (see https://github.com/rethinkdb/rethinkdb/issues/2055 ). You can probably work around that by using some custom JavaScript code through r.js(). Please let me know if this is important for you, so I can look into it.
If you want to group by combinations of multiple things, e.g. day and month:
r.table(...).group([r.row('timestamp').month(), r.row('timestamp').day()])
I have this table
training_schedules
id
course_reference
start_date(date)
end_date(date)
year_id(int, fk)
on my form, I have dropdownlist for the month, and another one for the year.
Now as you can see there is a mismatch on the month from form and database column. How can I filter the start_date or end_date column using only the integer value from the dropdownlist and ignore the day and year part of the db column?
I saw some examples but using raw query and using date functions of database which is not good if you consider performance because it is not indexable.
Can I achieve this using Eloquent/Fluent Api of Laravel?
If you are using mysql
u can use the month() function to get month from date
For further clarification please visit the link
I'm trying to make a filter in Jira like this:
issueType = MyIssueType ORDER BY YearOfDate(dueDateAndTime), MonthOfDate(duDateAndTime), DayOfDate(duDateAndTime), priority, dueDateAndTime
This would order all the tasks by the day of year, then priority, then by the actual time of day of the due date.
dueDateAndTime is a "custom field" of type "date and time" where you can pick the day and the exact hour of day.
Is there a way to extract the day, year or month from that kind of field?
JQL doesn't provide a possibility to extract specific parts from a datetime.
Does issuetype = MyIssueType ORDER BY dueDateAndTime ASC not work?
It would be possible in SQL, There is a plugin for that:
https://marketplace.atlassian.com/plugins/com.kintosot.jira.jdbc4jql/server/overview
You would use regular SQL syntax:
SELECT * FROM ISSUES GROUP BY YEAR(dueDateAndTime), MONTH(dueDateAndTime), DAY(dueDateAndTime);
Hope it helps.
I use SSRS 2005.I currently have two datetime parameters (for start and end dates) as parameters for my report. I get the default calendar controls to select the dates.
I want to show only month and year in the calendar control which can be selected by user. Is that possible?
I can create two text fields and let user enter month & year in each text field and i've two validate these two text fields. I dont want to do this because needs typing into the fields.
OR
I can create four dropdown lists for start month, start year and end month and end year with values but this involves clicking/scrolling a bit more. Dont want to do this either.
Can somebody suggest a solution?
Thank you
Bo
This cannot be done using the calendar control.
You can either use the calendar control ignoring the day or implement one of the other two solutions you mentioned.
In case of combobox, you can use select distinct month/year from your data to fill values.
To make this less annoying for your user's to run the report, default your month/year from/to values to these that usually the user selects to run the report.
Personally I would prefer textboxes with default values
eg. If user runs the report for current year from January to current month then the defaults would be
Month from: = 1
Month to: = Datepart("m", Now())
Year from, Year to: = Datepart("yyyy", Now())