Click to See Complete Forum and Search --> : Date Problem


February 19th, 2000, 12:39 PM
Hi,

how can I set a specific Date/Time to a Date DataType?

Dim myDate as Date


dim d, m, y, min, h, s as integer

'Month:

d = 25
m = 6
y = 1981
'Time:

min = 59
s = 59
h = 23

'Need some Code to set myDate to the Date #min/d/y h:m:s# (with the Variables, of course)

Sebastian

Aaron Young
February 19th, 2000, 03:01 PM
Try:
myDate = DateSerial(y, m, d) + TimeSerial(h, Min, s)
'or
myDate = CDate(y & "/" & m & "/" & d & " " & h & ":" & Min & ":" & s)



Aaron Young
Analyst Programmer
ajyoung@pressenter.com
aarony@redwingsoftware.com
Certified AllExperts Expert: http://www.allexperts.com/displayExpert.asp?Expert=11884