Hi Andrew,

> As far as I know there is no built in week function with OO.oBasic.
> Therefore I used the rather awkward example of calling an HSQL function
> from a basic statement.

Ripped the following from another document (and cannot remotely judge
how complete it is, but it looks complicated enough ;), perhaps it helps:

  ' Calculate the current week of the year (usually 1 .. 52)
  Function getWeekOfYear() As Integer
    Dim d As Date
    Dim t As Date

    d = Date()
    t = DateSerial(_
      Year(DateValue(d) + (8 - Weekday(d)) Mod 7 - 3), 1, 1)
    getWeekOfYear = (_
      DateValue(d) - t - 3 + (Weekday(t) + 1) Mod 7) \ 7 + 1
  End Function


Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to