C++/VB - Selecting current week in drop down

Asked By navin
24-Oct-07 08:10 AM
Hi All,

In a drop down box i am populating all the weeks from 1 to 52,  but
whenever the page loads, i want it show the current week number as
selected value.

Below is what is did:

option>

But when my page loads, the drop down box shows the last week in the
list (52), instead of current week which is 43.

please let me know i am missing something.

appreciate any ideas on this.

Thank you!!

Navin
SonOfRFC1036
(1)
FAQish
(1)
DatePart
(1)
Stockton
(1)
Turnpike
(1)
Acronyms
(1)
Week
(1)
Days
(1)
  Dr J R Stockton replied...
25-Oct-07 01:41 PM
In microsoft.public.scripting.vbscript message <1193227841.481293.154940
@v29g2000prd.googlegroups.com>, Wed, 24 Oct 2007 05:10:41, navin


Since there are 365 or 366 days in a year, 52 weeks cannot be
sufficient.


DatePart "ww" is buggy when generating ISO standard week numbers, and
therefore untrustworthy IMHO on any other form of week numbering.

A test of every day over 400 years should suffice; or 28 years for the
short-termists.


--
(c) John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v6.05   MIME.
Web  <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
help
d: \ Test \ Project.csv", ForReading) strSearchString = objFile.ReadAll objFile.Close objFSO.CreateTextFile "d: \ Test \ Project_" & DatePart("yyyy", Date) & Right("0" & DatePart("m", Date), 2) & Right("0" & DatePart("d", Date), 2) & ".csv" Set objFile = objFSO.OpenTextFile("d: \ Test \ Project_" & DatePart ("yyyy", Date) & Right("0" & DatePart("m", Date), 2) & Right("0 DatePart("d", Date), 2) & ".csv", ForWriting) strSearchString = Replace(strSearchString, VbCrLf, "") strSearchString = Replace(strSearchString, Vbtab, "") objFile.Write Set objInput = 3D objFSO.OpenTextFile("d: \ Test \ Project.csv", ForReading) objFSO.CreateTextFile "d: \ Test \ Project_" & DatePart("yyyy", Date) & Right("0" & DatePart("m", Date), 2) & Right("0" & DatePart("d", Date), 2) & ".csv" Set objOutput = 3D objFSO.OpenTextFile
ADODB.Recordset (1) System.Collections.ArrayList (1) Active Directory (1) Scripting.FileSystemObject (1) Word (1) SonOfRFC1036 (1) ADODB (1) Vilius Mock = FBnas schrieb: ? (1) use .Run or .Exec to do a OEis0fhIKHA.1020@TK2MSFT Read <http: / / en.wikipedia.org / wiki / Sorting_algorithm> and its links. - - (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web <URL:http: / / www.merlyn.demon.co.uk / > - FAQish topics, acronyms, & links. Proper < = 4-line sig. separator as above, a line exactly SonOfRFC1036) Do not Mail News to me. Before a reply, quote with "> " or "> " (SonOfRFC1036) In that case the differences between methods are not so marked. I get about 4 that the field order is not MDY of DMY, and is probably YMD. - - (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05. Web <URL:http: / / www.merlyn.demon.co.uk / > - w. FAQish topics, links, acronyms
from the current time. i appreciate your help. thanks, mcnewsxp VBScript Discussions Dr J R Stockton (1) Pascal (1) Date (1) Expression (1) London UK (1) Encoding (1) ReadLine (1) Calendar which is not a Leap year. Germany probably has a Law about it. - - (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05. Website <http: / / www.merlyn.demon.co.uk / > - w. FAQish topics, links, acronyms PAS EXE etc. : <http: / / www.merlyn.demon.co.uk / programs / > - see in d", bday, Date)<0 then age = age-1 '- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - Crash ~ Obi-Wan Kenobi ~ Dr J R Stockton <reply1040@merlyn.demon.co.uk> typed: Ok, you are right, my example was badly selected on convention, Feb 29 may need first to be reduced to Feb 28, - - (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05. Website <http: / / www.merlyn.demon.co.uk / > - w. FAQish topics, links, acronyms PAS EXE etc. : <http: / / www.merlyn.demon.co.uk / programs / > - see in
Request for DatePart test in Win7; need only read a Web page C++ / VB ISO Week Number in DatePart in VBS, at least up to Version 5.8, build 18702, is known to be URL:http: / / www.merlyn.demon.co.uk / vb-date2.htm#DP> "ISO Week Number Using DatePart", and to paste in reply the content of the first yellow box in subsection "Web in Windows Script Host as such, and in Office 2003 Word or equivalent. - - (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05. Web <URL:http: / / www.merlyn.demon.co.uk / > - w. FAQish topics, links, acronyms PAS EXE etc : <URL:http: / / www.merlyn.demon.co.uk / programs / > - see critdate.htm etc. VBScript Discussions Office 2003 (1) Windows 7 (1) Word (1) VBScript (1) FAQish (1) X64 (1) WeekNumber (1) DatePart (1) I do not know exactly what you want, but this is what I get
correct pattern to use? (without counting on the surrounding characters). VBScript Discussions Match.SubMatches (1) SonOfRFC1036 (1) Match.Value (1) RegEx.IgnoreCase (1) RegExM.Execute (1) RegExR.Pattern (1) RegExM.Pattern lastIndex - = 3 if (!A) break T.push(A[1]) } Result is in T. - - (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web <URL:http: / / www.merlyn.demon.co.uk / > - FAQqish topics, acronyms & links Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News. Dr J R Stockton wrote on 20 nov 2009 in microsoft.public.scripting.vbscript: why the i ? This can 3 ; J++) if ( ! / \ D / .test(S = St.substr(J, 4) ) ) T.push(S) - - (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web <URL:http: / / www.merlyn.demon.co.uk / > - FAQish topics, acronyms, & links. Proper < = 4-line sig. separator as above, a line exactly SonOfRFC1036) Do not Mail News to me. Before a reply, quote with "> " or "> " (SonOfRFC1036) keywords: Regular