So when I group using the WEEK() function it returns values based on a Tues-Mon week instead of the desired Mon-Sun. > For example, this year started on Tuesday 1/1. > I have a report that groups data by week and have learned today that it appears the week number assigned is set at 7 day intervals from the first day of the year, regardless of the day of week. Add a sort on the due date so that they appear in Monday to Sunday order in the grouping." > Then I grouped on this field, all jobs that are scheduled to run that week will be grouped together. > (if weekday(Date(JobOper.DueDate)) = 1 then (JobOper.DueDate - 6) else (JobOper.DueDate - weekday(JobOper.DueDate) + 2)) > "Create a calculated field call StartOfWeek > I have used this to calculate the Monday of the current week when I needed to group jobs by their due date SELECT AS Team, SUM() AS QTY, SUM( * 02)įROM, , = (CASE WHEN DAYOFWEEK(CURDATE()) = '1)' THEN (CURDATE() - 6) ELSE (CURDATE() - DAYOFWEEK(CURDATE()) + 2) END) (CASE WHEN DAYOFWEEK() = '1)' THEN ( - 6) ELSE ( - DAYOFWEEK() + 2) END) Here it is translated to accessing via ODBC: ![]() ![]() IF, THEN, ELSE = CASE WHEN, THEN, ELSE, END There were some syntax changes necessary to get it to work with the Progress ODBC driver:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |