<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        font-variant:normal !important;
        color:windowtext;
        text-transform:none;
        text-decoration:none none;
        vertical-align:baseline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='font-size:12.0pt'>Re Day of the week showing ???<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>I have a workaround that will work for 2021<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>When creating strings for labels for graphics<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>‘q time’<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>….<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>At the end of the string creation for Month, Year etc my string for year is ‘yearnum’<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>* code work around for 2021 correcting daystr error<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if yearnum = "2021"<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>daystr = daystring( monstr, datenum)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>daystring() is a function at the bottom of the script it takes two arguments monstr (a string for the month)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>and datenum (the current day of the month as a number.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>The function finds the day of the week name for the current date and returns this.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Does this by finding the month, if statement gets the 1<sup>st</sup> day of every month as a position in an array. MON is position 1 etc. The loop is used to move from the 1<sup>st</sup> day of the month till you reach the date in question. Then using the array you are able to return the day of the weeks name. Works well.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Trust this helps.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>The function<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>***********************************************<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>function daystring( monstr, datenum)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>monname = subwrd (monstr,1)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>daynum = subwrd (datenum,1)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = JAN)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 5<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = FEB)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = MAR)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = APR)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 4<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = MAY)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 6<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = JUN)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 2<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = JUL)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 4<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = AUG)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 7<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = SEP)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 3<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = OCT)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 5<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = NOV)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if (monname = DEC)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 3<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>while (daynum > 1)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = cposition + 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>** end array correction<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>if cposition > 7<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>cposition = 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>daynum = daynum - 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>endwhile<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>* Calculate the day name<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>dayarray = 'MON TUE WED THU FRI SAT SUN ????'<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>dayname = subwrd(dayarray,cposition)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>return dayname<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>regards Howard Staines<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Metris forecaster New Zealand.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p></div></body></html>