[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2558.0. "DatePart and 'firstweekofyear'" by BVOSV1::64566::M_DOHERTY (OO & CORBA Compliant) Thu May 15 1997 04:44

    Hi there,
    
    I'm using the DatePart function to return a week number from a date
    specified by a user. This works fine for years starting 1st Jan
    (default). 
    
    How / where do I define the 'firstweekofyear' value within the application
    if I want to use 1st July as the first week of the year ?
    
    Thanks in advance.
    
    Michael
T.RTitleUserPersonal
Name
DateLines
2558.1DSC000::CWINPENNYThu May 15 1997 06:238
    
    Seeing as how you can retrieve the week number for your own first week
    of the year and the actual week number it doesn't sound too difficult
    to determine your virtual week number.
    
    These days programmers are just too lazy.
    
    Chris
2558.2is this it?XSTACY::PATTISONA rolling stone gets the wormThu May 15 1997 06:296
	How about:

	DatePart("ww", dateadd("m", -6, dtValue))

	Dave
2558.3Defining 'firstweekofyear' ?BVOSV1::64566::M_DOHERTYOO & CORBA CompliantThu May 15 1997 14:3517
            RE: .1
            No, it ain't difficult at all but since the doc. indicates you
            can specify it, I'm interested in knowing how to set the
            'firstweekofyear' value.
    
    
            RE: .2
            Thanks for the response. That's similar to a workaround I've
            already implemented.
    
            Any pointers on setting the 'firstweekofyear' value ?
    
    
            Cheers,
    
            Michael