Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2008
Posts: 11
Reputation: era_chatterbox is an unknown quantity at this point 
Solved Threads: 0
era_chatterbox's Avatar
era_chatterbox era_chatterbox is offline Offline
Newbie Poster

Era

 
0
  #1
Jun 23rd, 2008
How to highlight a week if the week number is given. e.g. against week number 22, the form must show the dates ranging between 2/july/08 to 9/july/08.

Thanx in advance
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,104
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Era

 
0
  #2
Jun 23rd, 2008
findout the days .

add those many days to 1st of jan

then highlight those days.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: Era

 
0
  #3
Jun 23rd, 2008
Hi,
You can use DateAdd () Function

Syntax
DateAdd ( Interval As String, Number As Double, DateValue As Date ) As Date

Parameters
Interval - String expression representing the time interval you want to add
Give interval as "ww" for week
Number - Floating-point expression representing the number of intervals you want to add
Date - An expression representing the date and time to which the interval is to be added

Example

  1. Dim DateRangeFrom As Date
  2. Dim DateRangeTo As Date
  3. Dim WeekOfTheYear As Integer
  4.  
  5. WeekOfTheYear = 22
  6.  
  7. DateRangeFrom = DateAdd("ww", WeekOfTheYear - 1, CDate("1/1/2008"))
  8. DateRangeTo = DateRangeFrom + 7
  9. MsgBox " From " & DateRangeFrom & " To " & DateRangeTo
Last edited by selvaganapathy; Jun 23rd, 2008 at 1:47 pm.
KSG
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC