10-26-2009 11:34 AM
October has 5 Saturdays (3, 10, 17, 24 and 31). I have been trying to get a program to identify the closest Saturday PASSED, closest to the date selected. Example: Say I were to pick the 8th on a date Control VI. I need the program to identify the 3rd as being the closest passed saturday to the date selected. How do I do this programmatically?
10-26-2009 11:38 AM
Hi mattyk,
get the weekday from the picked day and go back the number of days accordingly (like if it's a Friday then go back 6 days)...
You know how to get the weekday of a given date? If not read the context help for the functions of the time palette!
10-26-2009 11:38 AM
Filthy trick, Get the week number from the with the string formatter and subtract 1, feed this to a format into string with a 7 as 'week of day' number.
Ton