Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Most recent date / Year / Week

Hi there,

I'm importing  dates into QV.

I'm extracting the field Year with 'Year (Date) as Year' and 'Weekstart(Date) as NumberWeek'

The I have a button that get the most recent date :

Action : Select in Field 'Date'  =Max(date(Date))

It works and select the most recent date.

For exemple 14/01/2013

As this date is selected (appears in green) I can see my list boxes  (Year and NumberWeek) with grey selection except for the latest Year (2013) and the corresponding NumberWeek (3) but I would like to get the green selection for those.

Any idea on how to implement this :

I've tried putting ohter action for my button :

Action : Select in Field 'Year' =Year(GetCurrentSelections(Date)) but it doesn't work...

GetCurrentSelections(Date) gives : Date = 14/01/2013

1 Solution

Accepted Solutions
Or
MVP
MVP

Week(max(Date)) and Year(max(Date)) looks like they'd do the trick. Alternatively, once you've selected the date, you can use Select Possible actions on your week and year fields. Either approach should work (I like the second one better).

View solution in original post

6 Replies
Not applicable
Author

Hi,

Can't you do the same as you did for the date field, but instead do =max(year(Date)) and =max(month(Date))?

Not applicable
Author

Unfortunately I can't.. I have data on several years...

So for exemple =max(NumberWeek(Date)) will give me 54 (from 2012 data) and latest NumberWeek is actually 3 (from 2013)...

MayilVahanan

Hi

Use max(MonthName(Datefield)) function

Can you post a sample file? Am not clear in it.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Or
MVP
MVP

Week(max(Date)) and Year(max(Date)) looks like they'd do the trick. Alternatively, once you've selected the date, you can use Select Possible actions on your week and year fields. Either approach should work (I like the second one better).

Not applicable
Author

If you do the date selection first and then the year and month selection you should get the right month and year.

Add three actions to your button.  The first action:

Action : Select in Field 'Date'  =Max(date(Date))

The second action Select in Field 'Year' =Max(Year(Date))

The third action Select in Field 'Month' =max(Month(Date))

Hope this helps


CELAMBARASAN
Partner - Champion
Partner - Champion

You can apply the same logic you have used for the date selection

Action : Select in Field 'Year'  =Year(Max(date(Date)))

Action : Select in Field 'Week'  =Week(date(Date))