I am trying to work with general date and wish to allways see the full date and time, but if i imput a date with the time of 00:00:00 it will only show the date part of it
Does anyone know how to stop this??
I am trying to work with general date and wish to allways see the full date and time, but if i imput a date with the time of 00:00:00 it will only show the date part of it
Does anyone know how to stop this??
Use the Now() function
dim todaysdate
todaysdate= Now()
Debug.Print todaysdate
On the Immediate screen you will have Data and time.
Note : general date gives only the date part of the date/time data you give. Alter the above code as per your need.
Happy to Help.
reply back if u had asked for something else
set your field date format to what you want.
To marianne,
The problem AJH1984 is facing, was faced even by me. Ideally if i use Format("todaysdate", General Date)...It has to give me both date and time...But will be giving only date, not the time.!!
what if format(date(),"mm/dd/yy hh:mm:ss") ?
I tried even this...in fact
Const conJetDate = "\#mm\/dd\/yyyy\#"
Format(Me.txtenddate, conJetDate)
did work...but not if i add hh,mm,ss
It would be helpful if you can modify the above code to suit this.
Const as in Constant. I have never used or tried using Const to equate to a certain format.
doesnt it work to directly use it format(me.txtenddate,"mm/dd/yyyy hh:mm:ss") ???
Sub datecheck()
Dim today As Date
todaywithnow = Now()
today = Format(today, "mm/dd/yyyy hh:mm:ss")
Debug.Print today
debu
End Sub
Sub datecheckwithnow()
Dim todaywithnow
todaywithnow = Now()
Debug.Print todaywithnow
End Sub
Sub datecheckwithconst()
Dim todaywithconst
todaywithconst = Date
Const conJetDate = "mm/dd/yyyy"
todaywithconst = Format(todaywithconst, conJetDate)
Debug.Print todaywithconst
End Sub
Call datecheck()
12:00:00 AM
Call datecheckwithnow()
6/19/2009 10:39:02 AM
Call datecheckwithconst()
06/19/2009
I am trying to work with general date and wish to allways see the full date and time, but if i imput a date with the time of 00:00:00 it will only show the date part of it
Does anyone know how to stop this??
==========================
I see that the problem relies on the field in the form not showing the full general date.
i have created you this file. Is that what you've been looking?
Function IsDupeslam(cs1 As String, cs2 As String, cs3 As String, cs4 as date)
Dim y As Integer
cs4 = Format(cs4, "Short Date")
y = DatePart("m", cs4)
debug.print cs4
debug.print y
End Function
debug.printt cs4 gives 12.01.01
debug.print y gives 12
Sub testdate(t1 As Date)
Dim s As Integer
t1 = Format(t1, "mm/dd/yy")
Debug.Print t
s = DatePart("m", t1)
Debug.Print s
End Sub
Call testdate(06/19/2009)
is giving 12