| | |
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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
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
VB Syntax (Toggle Plain Text)
Dim DateRangeFrom As Date Dim DateRangeTo As Date Dim WeekOfTheYear As Integer WeekOfTheYear = 22 DateRangeFrom = DateAdd("ww", WeekOfTheYear - 1, CDate("1/1/2008")) DateRangeTo = DateRangeFrom + 7 MsgBox " From " & DateRangeFrom & " To " & DateRangeTo
Last edited by selvaganapathy; Jun 23rd, 2008 at 1:47 pm.
KSG
![]() |
Similar Threads
- The Past-----Memory Bliss! (Geeks' Lounge)
- could an old machine run linux (Getting Started and Choosing a Distro)
- MERGED: ram upgrade/help installing (Motherboards, CPUs and RAM)
- CPU hangs at 100% after installing harddrive and win xp (Viruses, Spyware and other Nasties)
- Fdisk/format Need Help Ibmthinkpad 600 (Windows 95 / 98 / Me)
- Need advice for buying iBook laptop. (IT Professionals' Lounge)
- what is this???? (Viruses, Spyware and other Nasties)
- upgrading to MacOs X from 9.1 (OS X)
- Celeron 466. whats it worth? (Motherboards, CPUs and RAM)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: COMPILE A "STANDALONE" .EXE FILE
- Next Thread: code for connecting two varaible fields in two forms
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






