Asked By
kurt pry
0 points
N/A
Posted on - 12/19/2012
In starting a program in Visual Basic I want my dates to be compatible with World Time Zone.
In VB coding how to add one to date and allow functionality in Access?
If it doesn't work for Access, will Excel?
In VB coding how to add one to date?
Hi Kurt Pry,
You can use DateAdd function in VB script to add dates.
Â
Below is the syntax for the same.
Â
DateAdd ( Timeinterval, value, date )
Â
Timeinterval can be of the following types.
Â
yyyy – Year
q – Quarter
m – Month
y – Day of the year
d – Day
w – Weekday
ww – Week
h – Hour
n – Minute
s – Second
Â
Value is the interval you want to add
date is the date to which value will be added
Â
It can be used in VB script
below is a sample code.
Â
Dim NewDate As Date
Â
NewDate = DateAdd ("n", 53, #29/10/2012 10:31:58 AM#)
Â
It is applicable to all versions of Access.
Â
Hope it helps.