Getting Fields to come out as date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 fields, a date and a time. How do I get them into the CDbl( )
formula? The CDbl wants it to be: CDbl(#date#). I keep getting type
mismatch when I try to use my value in my textbox. So I want to get this:

txtDate = 11/1/2005
txtTime= 2:00:00 PM

CDbl(txtDate & txtTime)= numeric value from date and time

But I can't get the Date and Time into a correct format to use the formulas.
Thanks!
 
Kou Vang said:
I have 2 fields, a date and a time. How do I get them into the CDbl(
) formula? The CDbl wants it to be: CDbl(#date#). I keep getting
type mismatch when I try to use my value in my textbox. So I want to
get this:

txtDate = 11/1/2005
txtTime= 2:00:00 PM

CDbl(txtDate & txtTime)= numeric value from date and time

But I can't get the Date and Time into a correct format to use the
formulas. Thanks!

Are txtDate and txtTime text fields? If so, you'll have to convert them
into Date fields first. You could do this:

x = CDbl(CDate(txtDate & " " & txtTime))

or this:

x = CDbl(CDate(txtDate) + CDate(txtTime))
 
Back
Top