Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impromtu Function inverted Week( )

Status
Not open for further replies.

JackONeill

Programmer
Mar 8, 2004
65
US
Hello,

here is a function in impromptu:

Syntax: week (date_exp)
Returns the week of the year in date_exp as an integer value in the range 1 - 53.

Very good but i need the reverse !!

from the week number it give you the Month !!

do you know the function name?


Cya
 
There isn't a single function to accomplish what you need, but you could miltiply the week number by 7 to give you the day of the year, and then do an If--Then--Else statement to determine the month i.e.

If(WkNo * 7 between 1 and 31) then('Jan')else if(EkNo * 7 between 32 and 59) then ('Feb')..........

and so on

HTH



Gary Parker
MIS Data Analyst
Manchester, England
 
Yes i though this method too... :)

But this is the hard way !!

i though there was a easy way

thanks !
 
Try this:

Month(add-days('2004-01-01',weeknum*7))

You supply weeknum and it returns the month.

Pain is stress leaving the body.

DoubleD [bigcheeks]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top