Getting start date of week for an entered date

Following on from my previous post, I have another totally unrelated question. I am trying to create a form, into which the user will enter a date. I want to then take that date and calculate from it what the start date of the week in which the entered date falls into. For example, if the week start day is Monday, and todays date is entered, a date of 29/03/04 will be returned. If I enter next Thursdays date (8th April), a date of 25/03/04 will be returned. Ideally, I wish to have control over what the start day for a given week is. TIA Gary

See also HELP for system ==> date==> calcdate Expr2 := ‘-WD1’; // The last weekday no.1, (last Monday…2 = tuesday) RefDate := 010404D;//thursday 1st of april Date2 := CALCDATE(Expr2, RefDate); MESSAGE(‘The expression: %1 returns %2 from %3’, Expr2, Date2, RefDate); variables: Expr2 = Code10 RefDate = Date Date2 = Date

Hi Gary You’ll need to use the CALCDATE command e.g. StartofWeek := CALCDATE(’<-CW>’,WORKDATE);

Perfect thank you. I’m still finding my way around extracting information out of the help!