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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Week Commencing formula

Status
Not open for further replies.

grabrail

Technical User
Aug 15, 2001
269
GB
Can anybody help,

I need a formula to display Week commencing day, month and year. for the specific week of the year.

I.e. if I run the report tody, I want it to display monday 4th December 2006

Cheers
 
Try:

whileprintingrecords;
stringvar Myday:="";
if right(totext(day(currentdate),0,""),1) = "1" then
Myday:=totext(day(currentdate),0,"")+"st"
else
if right(totext(day(currentdate),0,""),1) = "2" then
Myday:=totext(day(currentdate),0,"")+"2nd"
else
if right(totext(day(currentdate),0,""),1) = "3" then
Myday:=totext(day(currentdate),0,"")+"3rd"
else
if day(currentdate) in [4 to 30] then
Myday:=totext(day,0,"")+"th";
totext(currentdate,"dddd") & " " & MyDay & " " & totext(currentdate,"MMMM") & " " & totext(year(currentdate),0,"")

-k
 
Thanks for this

However the following line produces an error

Myday:=totext(day,0,"")+"th";

"not enough arguments....." and highlights the word day.

I tried making the line look like this

Myday:=totext(day(currentdate),0,"")+"th";

But the output is just todays date.

Any ideas?

Cheers

J
 
Try:

whileprintingrecords;
stringvar Myday:="";
if totext(day(currentdate),0,"") = "1" then
Myday:=totext(day(currentdate),0,"")+"st"
else
if totext(day(currentdate),0,"") = "2" then
Myday:=totext(day(currentdate),0,"")+"nd"
else
if totext(day(currentdate),0,"") = "3" then
Myday:=totext(day(currentdate),0,"")+"rd"
else
if day(currentdate) in [4 to 30] then
Myday:=totext(day(currentdate),0,"")+"th";
totext(currentdate,"dddd") & " " & MyDay & " " & totext(currentdate,"MMMM") & " " & totext(year(currentdate),0,"")

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top