473,836 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calendar Week Number

Could someone, anyone please tell me what I need to amend, to get this
function to take Sunday as the first day of the week?

I amended the Weekday parts to vbSunday (in my code, not the code
attached), yet when I ran it for 28/09/2003 (UK date format) it
returned Week 39. I would have expected it to return Week 40.
However, I'm really stuck and my head is busting over this, so any
pointers would be gratefully appreciated.

Many thanks in advance

Cheers,

Phil

'============== =============== =============== ====
'Function obtained from Microsoft Knowledge Base
'Q200299. It returns correct Weeknumbers as per ISO 8601
'and works around known week numbering bug in Access
'============== =============== =============== ====
Function WeekNumber(InDa te As Date) As Integer
Dim DayNo As Integer
Dim StartDays As Integer
Dim StopDays As Integer
Dim StartDay As Integer
Dim StopDay As Integer
Dim VNumber As Integer
Dim ThurFlag As Boolean

On Error GoTo HandleErr
DayNo = Days(InDate)
StartDay = WeekDay(DateSer ial(Year(InDate ), 1, 1)) - 1
StopDay = WeekDay(DateSer ial(Year(InDate ), 12, 31)) - 1
' Number of days belonging to first calendar week
StartDays = 7 - (StartDay - 1)
' Number of days belonging to last calendar week
StopDays = 7 - (StopDay - 1)
' Test to see if the year will have 53 weeks or not
If StartDay = 4 Or StopDay = 4 Then ThurFlag = True Else ThurFlag =
False
VNumber = (DayNo - StartDays - 4) / 7
' If first week has 4 or more days, it will be calendar week 1
' If first week has less than 4 days, it will belong to last year's
' last calendar week
If StartDays >= 4 Then
WeekNumber = Fix(VNumber) + 2
Else
WeekNumber = Fix(VNumber) + 1
End If
' Handle years whose last days will belong to coming year's first
' calendar week
If WeekNumber > 52 And ThurFlag = False Then WeekNumber = 1
' Handle years whose first days will belong to the last year's
' last calendar week
If WeekNumber = 0 Then
WeekNumber = WeekNumber(Date Serial(Year(InD ate) - 1, 12, 31))
End If
ExitHere:
Exit Function

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description ,
vbCritical, "Form_frmBfPick ADate.WeekNumbe r"
End Select

End Function

'============== =============== =============== ====

'Function obtained from Microsoft Knowledge Base
'Q200299
'Called by Weeknumber()
'============== =============== =============== ====

Function Days(DayNo As Date) As Integer
On Error GoTo HandleErr
Days = DayNo - DateSerial(Year (DayNo), 1, 0)
ExitHere:
Exit Function

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description ,
vbCritical, "Form_frmBfPick ADate.Days"
End Select

End Function
Nov 12 '05 #1
7 15153
"Shuffs" <ph****@globaln et.co.uk> wrote in message
news:54******** *************** ***@posting.goo gle.com...
Could someone, anyone please tell me what I need to amend, to get this
function to take Sunday as the first day of the week?

I amended the Weekday parts to vbSunday (in my code, not the code
attached), yet when I ran it for 28/09/2003 (UK date format) it
returned Week 39. I would have expected it to return Week 40.
However, I'm really stuck and my head is busting over this, so any
pointers would be gratefully appreciated.

Many thanks in advance

Cheers,

Phil

'============== =============== =============== ====
'Function obtained from Microsoft Knowledge Base
'Q200299. It returns correct Weeknumbers as per ISO 8601
'and works around known week numbering bug in Access
'============== =============== =============== ====
Function WeekNumber(InDa te As Date) As Integer
Dim DayNo As Integer
Dim StartDays As Integer
Dim StopDays As Integer
Dim StartDay As Integer
Dim StopDay As Integer
Dim VNumber As Integer
Dim ThurFlag As Boolean

On Error GoTo HandleErr
DayNo = Days(InDate)
StartDay = WeekDay(DateSer ial(Year(InDate ), 1, 1)) - 1
StopDay = WeekDay(DateSer ial(Year(InDate ), 12, 31)) - 1
' Number of days belonging to first calendar week
StartDays = 7 - (StartDay - 1)
' Number of days belonging to last calendar week
StopDays = 7 - (StopDay - 1)
' Test to see if the year will have 53 weeks or not
If StartDay = 4 Or StopDay = 4 Then ThurFlag = True Else ThurFlag =
False
VNumber = (DayNo - StartDays - 4) / 7
' If first week has 4 or more days, it will be calendar week 1
' If first week has less than 4 days, it will belong to last year's
' last calendar week
If StartDays >= 4 Then
WeekNumber = Fix(VNumber) + 2
Else
WeekNumber = Fix(VNumber) + 1
End If
' Handle years whose last days will belong to coming year's first
' calendar week
If WeekNumber > 52 And ThurFlag = False Then WeekNumber = 1
' Handle years whose first days will belong to the last year's
' last calendar week
If WeekNumber = 0 Then
WeekNumber = WeekNumber(Date Serial(Year(InD ate) - 1, 12, 31))
End If
ExitHere:
Exit Function

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description ,
vbCritical, "Form_frmBfPick ADate.WeekNumbe r"
End Select

End Function

'============== =============== =============== ====

'Function obtained from Microsoft Knowledge Base
'Q200299
'Called by Weeknumber()
'============== =============== =============== ====

Function Days(DayNo As Date) As Integer
On Error GoTo HandleErr
Days = DayNo - DateSerial(Year (DayNo), 1, 0)
ExitHere:
Exit Function

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description ,
vbCritical, "Form_frmBfPick ADate.Days"
End Select

End Function


Hi Phil

No-one else seems to have answered - and I am a bit puzzled too. You
changed the code for the function and now it no longer works as expected?
So why did you change the code?
The code says in its description that it is working to the ISO 8601
standard - an internationally accepted standard which can only return one
possible week number for the date of September 28, 2003. That is week
number 39. The standard says that Week No 1 contains the fourth day of
January and you can count from there. I have my own version of this
function, but I have no reason to suspect this one is flawed. If it helps
at all, I have included a printout for 2003, but perhaps you can let us know
what value you wanted the function to return for the above-mentioned date
and which standard you are working to.

HTH

Fletcher

30 31 01 02 03 04 05 2003W01 Jan-03
06 07 08 09 10 11 12 2003W02
13 14 15 16 17 18 19 2003W03
20 21 22 23 24 25 26 2003W04
27 28 29 30 31 01 02 2003W05 Feb-03
03 04 05 06 07 08 09 2003W06
10 11 12 13 14 15 16 2003W07
17 18 19 20 21 22 23 2003W08
24 25 26 27 28 01 02 2003W09 Mar-03
03 04 05 06 07 08 09 2003W10
10 11 12 13 14 15 16 2003W11
17 18 19 20 21 22 23 2003W12
24 25 26 27 28 29 30 2003W13
31 01 02 03 04 05 06 2003W14 Apr-03
07 08 09 10 11 12 13 2003W15
14 15 16 17 18 19 20 2003W16
21 22 23 24 25 26 27 2003W17
28 29 30 01 02 03 04 2003W18 May-03
05 06 07 08 09 10 11 2003W19
12 13 14 15 16 17 18 2003W20
19 20 21 22 23 24 25 2003W21
26 27 28 29 30 31 01 2003W22 Jun-03
02 03 04 05 06 07 08 2003W23
09 10 11 12 13 14 15 2003W24
16 17 18 19 20 21 22 2003W25
23 24 25 26 27 28 29 2003W26
30 01 02 03 04 05 06 2003W27 Jul-03
07 08 09 10 11 12 13 2003W28
14 15 16 17 18 19 20 2003W29
21 22 23 24 25 26 27 2003W30
28 29 30 31 01 02 03 2003W31 Aug-03
04 05 06 07 08 09 10 2003W32
11 12 13 14 15 16 17 2003W33
18 19 20 21 22 23 24 2003W34
25 26 27 28 29 30 31 2003W35
01 02 03 04 05 06 07 2003W36 Sep-03
08 09 10 11 12 13 14 2003W37
15 16 17 18 19 20 21 2003W38
22 23 24 25 26 27 28 2003W39
29 30 01 02 03 04 05 2003W40 Oct-03
06 07 08 09 10 11 12 2003W41
13 14 15 16 17 18 19 2003W42
20 21 22 23 24 25 26 2003W43
27 28 29 30 31 01 02 2003W44 Nov-03
03 04 05 06 07 08 09 2003W45
10 11 12 13 14 15 16 2003W46
17 18 19 20 21 22 23 2003W47
24 25 26 27 28 29 30 2003W48
01 02 03 04 05 06 07 2003W49 Dec-03
08 09 10 11 12 13 14 2003W50
15 16 17 18 19 20 21 2003W51
22 23 24 25 26 27 28 2003W52
29 30 31 01 02 03 04 2004W01 Jan-04
Nov 12 '05 #2
Hi Fletcher,

Many thanks for the reply and additional WeekNumber information.
I've re-read my original post and can now see how it is unclear -
apologies for that.

The original code I posted returns week 39 for the date 28/09/2003
(28th September 2003 - UK date format) - this is indeed correct, as it
works to the ISO standard.
What I wanted to do was take the code, and change the variables of
StartDay and StopDay, so that Sunday would be classed as the first day
of the week, not a Monday. Doing this in my code didn't give me what I
wanted, understandbly because firstly, I didn't cotton on to the ISO
standard bit and I'm not really the sharpesty tool in the box when it
comes to writing functions!

With hindsight, I should've looked up ISO8601! If this function works
to a particular standard then it will return the value to that
standard - doing exactly as it says on the tin!

What I am ultimately trying to achieve is a function (or set of
functions) that on taking a date, will return my Company financial
week number and year.
Our financial year runs from October to September, our trading week
runs from Sunday to Saturday.
Therefore, Saturday 27th 2003 is the 52nd week of Financial Year 2003,
28th September 2003 is the 1st week of Financial Year 2004.

I thought that if I could modify the original code I posted, I could
be on the first steps to doing this! I should of looked a bit deeper
than I actually did!

Anyhow, thanks again for the response - I now know I need to look
again at this!

Cheers,

Phil
"Fletcher Arnold" <fl****@home.co m> wrote in message news:<bm******* ***@hercules.bt internet.com>.. .
"Shuffs" <ph****@globaln et.co.uk> wrote in message
news:54******** *************** ***@posting.goo gle.com...
Could someone, anyone please tell me what I need to amend, to get this
function to take Sunday as the first day of the week?

I amended the Weekday parts to vbSunday (in my code, not the code
attached), yet when I ran it for 28/09/2003 (UK date format) it
returned Week 39. I would have expected it to return Week 40.
However, I'm really stuck and my head is busting over this, so any
pointers would be gratefully appreciated.

Many thanks in advance

Cheers,

Phil

'============== =============== =============== ====
'Function obtained from Microsoft Knowledge Base
'Q200299. It returns correct Weeknumbers as per ISO 8601
'and works around known week numbering bug in Access
'============== =============== =============== ====
Function WeekNumber(InDa te As Date) As Integer
Dim DayNo As Integer
Dim StartDays As Integer
Dim StopDays As Integer
Dim StartDay As Integer
Dim StopDay As Integer
Dim VNumber As Integer
Dim ThurFlag As Boolean

On Error GoTo HandleErr
DayNo = Days(InDate)
StartDay = WeekDay(DateSer ial(Year(InDate ), 1, 1)) - 1
StopDay = WeekDay(DateSer ial(Year(InDate ), 12, 31)) - 1
' Number of days belonging to first calendar week
StartDays = 7 - (StartDay - 1)
' Number of days belonging to last calendar week
StopDays = 7 - (StopDay - 1)
' Test to see if the year will have 53 weeks or not
If StartDay = 4 Or StopDay = 4 Then ThurFlag = True Else ThurFlag =
False
VNumber = (DayNo - StartDays - 4) / 7
' If first week has 4 or more days, it will be calendar week 1
' If first week has less than 4 days, it will belong to last year's
' last calendar week
If StartDays >= 4 Then
WeekNumber = Fix(VNumber) + 2
Else
WeekNumber = Fix(VNumber) + 1
End If
' Handle years whose last days will belong to coming year's first
' calendar week
If WeekNumber > 52 And ThurFlag = False Then WeekNumber = 1
' Handle years whose first days will belong to the last year's
' last calendar week
If WeekNumber = 0 Then
WeekNumber = WeekNumber(Date Serial(Year(InD ate) - 1, 12, 31))
End If
ExitHere:
Exit Function

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description ,
vbCritical, "Form_frmBfPick ADate.WeekNumbe r"
End Select

End Function

'============== =============== =============== ====

'Function obtained from Microsoft Knowledge Base
'Q200299
'Called by Weeknumber()
'============== =============== =============== ====

Function Days(DayNo As Date) As Integer
On Error GoTo HandleErr
Days = DayNo - DateSerial(Year (DayNo), 1, 0)
ExitHere:
Exit Function

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description ,
vbCritical, "Form_frmBfPick ADate.Days"
End Select

End Function


Hi Phil

No-one else seems to have answered - and I am a bit puzzled too. You
changed the code for the function and now it no longer works as expected?
So why did you change the code?
The code says in its description that it is working to the ISO 8601
standard - an internationally accepted standard which can only return one
possible week number for the date of September 28, 2003. That is week
number 39. The standard says that Week No 1 contains the fourth day of
January and you can count from there. I have my own version of this
function, but I have no reason to suspect this one is flawed. If it helps
at all, I have included a printout for 2003, but perhaps you can let us know
what value you wanted the function to return for the above-mentioned date
and which standard you are working to.

HTH

Fletcher

30 31 01 02 03 04 05 2003W01 Jan-03
06 07 08 09 10 11 12 2003W02
13 14 15 16 17 18 19 2003W03
20 21 22 23 24 25 26 2003W04
27 28 29 30 31 01 02 2003W05 Feb-03
03 04 05 06 07 08 09 2003W06
10 11 12 13 14 15 16 2003W07
17 18 19 20 21 22 23 2003W08
24 25 26 27 28 01 02 2003W09 Mar-03
03 04 05 06 07 08 09 2003W10
10 11 12 13 14 15 16 2003W11
17 18 19 20 21 22 23 2003W12
24 25 26 27 28 29 30 2003W13
31 01 02 03 04 05 06 2003W14 Apr-03
07 08 09 10 11 12 13 2003W15
14 15 16 17 18 19 20 2003W16
21 22 23 24 25 26 27 2003W17
28 29 30 01 02 03 04 2003W18 May-03
05 06 07 08 09 10 11 2003W19
12 13 14 15 16 17 18 2003W20
19 20 21 22 23 24 25 2003W21
26 27 28 29 30 31 01 2003W22 Jun-03
02 03 04 05 06 07 08 2003W23
09 10 11 12 13 14 15 2003W24
16 17 18 19 20 21 22 2003W25
23 24 25 26 27 28 29 2003W26
30 01 02 03 04 05 06 2003W27 Jul-03
07 08 09 10 11 12 13 2003W28
14 15 16 17 18 19 20 2003W29
21 22 23 24 25 26 27 2003W30
28 29 30 31 01 02 03 2003W31 Aug-03
04 05 06 07 08 09 10 2003W32
11 12 13 14 15 16 17 2003W33
18 19 20 21 22 23 24 2003W34
25 26 27 28 29 30 31 2003W35
01 02 03 04 05 06 07 2003W36 Sep-03
08 09 10 11 12 13 14 2003W37
15 16 17 18 19 20 21 2003W38
22 23 24 25 26 27 28 2003W39
29 30 01 02 03 04 05 2003W40 Oct-03
06 07 08 09 10 11 12 2003W41
13 14 15 16 17 18 19 2003W42
20 21 22 23 24 25 26 2003W43
27 28 29 30 31 01 02 2003W44 Nov-03
03 04 05 06 07 08 09 2003W45
10 11 12 13 14 15 16 2003W46
17 18 19 20 21 22 23 2003W47
24 25 26 27 28 29 30 2003W48
01 02 03 04 05 06 07 2003W49 Dec-03
08 09 10 11 12 13 14 2003W50
15 16 17 18 19 20 21 2003W51
22 23 24 25 26 27 28 2003W52
29 30 31 01 02 03 04 2004W01 Jan-04

Nov 12 '05 #3
"Shuffs" <ph****@globaln et.co.uk> wrote in message
news:54******** *************** ***@posting.goo gle.com...
Hi Fletcher,

Many thanks for the reply and additional WeekNumber information.
I've re-read my original post and can now see how it is unclear -
apologies for that.

The original code I posted returns week 39 for the date 28/09/2003
(28th September 2003 - UK date format) - this is indeed correct, as it
works to the ISO standard.
What I wanted to do was take the code, and change the variables of
StartDay and StopDay, so that Sunday would be classed as the first day
of the week, not a Monday. Doing this in my code didn't give me what I
wanted, understandbly because firstly, I didn't cotton on to the ISO
standard bit and I'm not really the sharpesty tool in the box when it
comes to writing functions!

With hindsight, I should've looked up ISO8601! If this function works
to a particular standard then it will return the value to that
standard - doing exactly as it says on the tin!

What I am ultimately trying to achieve is a function (or set of
functions) that on taking a date, will return my Company financial
week number and year.
Our financial year runs from October to September, our trading week
runs from Sunday to Saturday.
Therefore, Saturday 27th 2003 is the 52nd week of Financial Year 2003,
28th September 2003 is the 1st week of Financial Year 2004.

I thought that if I could modify the original code I posted, I could
be on the first steps to doing this! I should of looked a bit deeper
than I actually did!

Anyhow, thanks again for the response - I now know I need to look
again at this!

Cheers,

Phil

Hi Phil
If I understand you correctly, the first week of a financial year always
contains October 1st in which case your function could be as shown below. I
think it's correct, but before you get into trouble with your finance
department, you might like to try it for yourself.

' *************** *************** *************** *************
Public Function FinancialWeek(d te As Date) As String

Dim dteSat As Date ' The last day of the week
Dim intFinYear As Integer ' The financial year
Dim dteFinStart As Date ' The first date of the financial year

If Month(dte) > 9 Then
intFinYear = Year(dte) + 1
Else
dteSat = dte + 7 - WeekDay(dte, vbSunday)
If dteSat > DateSerial(Year (dte), 9, 30) Then
intFinYear = Year(dte) + 1
Else
intFinYear = Year(dte)
End If
End If

dteFinStart = 1 + DateSerial(intF inYear - 1, 10, 1) - _
WeekDay(DateSer ial(intFinYear - 1, 10, 1), vbSunday)

FinancialWeek = intFinYear & "W" & Format((1 + (dte - dteFinStart) \ 7),
"00")

End Function

' *************** *************** *************** *************
Nov 12 '05 #4
Hi Fletcher,

Don't you realise what you've done?
I have been picking this up and putting it down for over two years
with the aim of coming up with a solution!! It was a pet project that
I could take or leave, which fills those moments when I've some time
to tinker!
What am I going to do now, (once I've picked each line apart, to
understand how it works!)? <g>

Joking aside, a sincere thanks for the response and a function to
boot!

Your function is coming up trumps each time I test it, with various
scenarios.

All I can say is a very sincere thank you, and it is very very much
appreciated.

A heartfelt cheers,

Phil
"Fletcher Arnold" <fl****@home.co m> wrote in message news:<bn******* ***@sparta.btin ternet.com>...
Hi Phil
If I understand you correctly, the first week of a financial year always
contains October 1st in which case your function could be as shown below. I
think it's correct, but before you get into trouble with your finance
department, you might like to try it for yourself.

' *************** *************** *************** *************
Public Function FinancialWeek(d te As Date) As String

Dim dteSat As Date ' The last day of the week
Dim intFinYear As Integer ' The financial year
Dim dteFinStart As Date ' The first date of the financial year

If Month(dte) > 9 Then
intFinYear = Year(dte) + 1
Else
dteSat = dte + 7 - WeekDay(dte, vbSunday)
If dteSat > DateSerial(Year (dte), 9, 30) Then
intFinYear = Year(dte) + 1
Else
intFinYear = Year(dte)
End If
End If

dteFinStart = 1 + DateSerial(intF inYear - 1, 10, 1) - _
WeekDay(DateSer ial(intFinYear - 1, 10, 1), vbSunday)

FinancialWeek = intFinYear & "W" & Format((1 + (dte - dteFinStart) \ 7),
"00")

End Function

' *************** *************** *************** *************

Nov 12 '05 #5
On 20 Oct 2003 02:36:51 -0700, ph****@globalne t.co.uk (Shuffs) wrote:
What I am ultimately trying to achieve is a function (or set of
functions) that on taking a date, will return my Company financial
week number and year.


Did you consider storing this important business data in a table?
That's where data belongs, right?

--
Mike Sherrill
Information Management Systems
Nov 12 '05 #6

"Shuffs" <ph****@globaln et.co.uk> wrote in message
news:54******** *************** ***@posting.goo gle.com...
Hi Fletcher,

Don't you realise what you've done?
I have been picking this up and putting it down for over two years
with the aim of coming up with a solution!! It was a pet project that
I could take or leave, which fills those moments when I've some time
to tinker!
What am I going to do now, (once I've picked each line apart, to
understand how it works!)? <g>

Joking aside, a sincere thanks for the response and a function to
boot!

Your function is coming up trumps each time I test it, with various
scenarios.

All I can say is a very sincere thank you, and it is very very much
appreciated.

A heartfelt cheers,

Phil

Very pleased to hear it's doing what you wanted. It's always nice to get
some feedback - it sure beats a 'thanx in advance'. If it helps, this is
how the function works:

* Find the financial year the date belongs to:
If the month is bigger than 9, add a year.
If not, then if the coming Saturday is in October, add a year - otherwise
the financial year and the calendar year are the same.

* Find date the start of the financial year:
This happens on the Monday of the week containing the 1st October of the
previous year.

* Find the number of days elapsed:

* Divide by 7 (removing any remainder) and add 1 to get the week number

PS
I hope you will be able to find a replacement pet project to tinker with <g>

Fletcher
Nov 12 '05 #7
Thanks for the pointers to what the code does, I've added them as
comments to the function itself!

I've decided that I really do need to improve my VBA skills, and I
need another pet project to accomplish this.

I think I'll have a go at building an Add-In - I'm thinking of a
'Wizard' add-in, one with a spell-checker! Should keep me busy!! <G>

Thanks again!

Phil
"Fletcher Arnold" <fl****@home.co m> wrote in message news:<bn******* ***@titan.btint ernet.com>...
"Shuffs" <ph****@globaln et.co.uk> wrote in message
news:54******** *************** ***@posting.goo gle.com...
Hi Fletcher,

Don't you realise what you've done?
I have been picking this up and putting it down for over two years
with the aim of coming up with a solution!! It was a pet project that
I could take or leave, which fills those moments when I've some time
to tinker!
What am I going to do now, (once I've picked each line apart, to
understand how it works!)? <g>

Joking aside, a sincere thanks for the response and a function to
boot!

Your function is coming up trumps each time I test it, with various
scenarios.

All I can say is a very sincere thank you, and it is very very much
appreciated.

A heartfelt cheers,

Phil

Very pleased to hear it's doing what you wanted. It's always nice to get
some feedback - it sure beats a 'thanx in advance'. If it helps, this is
how the function works:

* Find the financial year the date belongs to:
If the month is bigger than 9, add a year.
If not, then if the coming Saturday is in October, add a year - otherwise
the financial year and the calendar year are the same.

* Find date the start of the financial year:
This happens on the Monday of the week containing the 1st October of the
previous year.

* Find the number of days elapsed:

* Divide by 7 (removing any remainder) and add 1 to get the week number

PS
I hope you will be able to find a replacement pet project to tinker with <g>

Fletcher

Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2199
by: Daniel Wilhelm | last post by:
Hi, does someone knows a good JS PopUp Calendar for a form-field, that also shows the WeekOfYear? Thanks, Dan
19
2111
by: Stimp | last post by:
preferably one that when clicked can update three date dropdowns (day, month, year) like http://www.visitdublin.com/carhire/avis.asp Don't mind paying for the file... anyone seen something like this? -- "I hear ma train a comin' .... hear freedom comin"
15
3855
by: tigrfire | last post by:
I'm trying to write a program that will display the following output: MONTHLY CALENDAR This program displays a calendar. You need to provide the day of the week on which January 1 falls, and indicate whether or not the year is a leap year. Enter the code number for the day of the week on which January 1 falls: 0- Sun 1- Mon 2- Tue 3- Wed 4- Thu 5- Fri 6- Sat
2
6752
by: patrick delifer | last post by:
I am binding some data to a calendar control. Since I don't want to return all the Data from the DB, I would like to return only the data for the current view of the calendar. The calendar has always 42 cells. I would like to know if there is a way to know which date is displayed in the first cell of the calendar. Unfortuantely, there is no index in the calendar. ( I could go with the SelectedDate.Today as a reference and then subtract and...
0
1910
by: larry | last post by:
I am in the process of rewriting one of my first PHP scripts, an event calendar, and wanted to share the code that is the core of the new calendar. My current/previous calendar processed data dates only, this code is intended to use more thrifty event descriptions (3rd saturday, last tuesday, etc.) as well as traditional one-of dates. The core here here is quite spartan, no table logic or or db cruft included (I figure you have our own...
3
2209
by: want2learn | last post by:
Hi I have this code, and it works very well. <form runat="server"> <asp:Calendar id=Calendar1 runat="server" Height="160px" Width="224px" NextMonthText = "<img src='images/arrowRight.gif' border=0>" PrevMonthText = "<img src='images/arrowLeft.gif' border=0>" FirstDayOfWeek="Monday"
4
3380
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters the comments and clicks the save button then the date and the date will be stored in the mysql database. This is working fine. But my problem is when, after the user had made an entry the date in the calendar for which an entry has made should be...
1
4912
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to...
1
3467
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i have to made in my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type"...
0
10860
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10560
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6984
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5659
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5831
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4466
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.