Left, Right, Mid Commands?

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

Guest

I'm trying to pull just the date from the front of a date/time field. I'm
currently using the Left function "Date In: Left([Date Time],10)", but since
my date/time field has no place holders (e.g. 9/9/2005 appears, not
09/09/2005), between January and October I've been changing the the function
to 9 characters (or else my formula picks up the first digit of the time). Is
there a better way? Perhaps pull the characters from the left of the date and
count left from there? My Data looks like this: "9/9/2005 01:25:30"

Thanks, Dave
 
Worked like a charm! Thanks

Robert_DubYa said:
Dave,

use the datevalue function.

example:
DateValue([Date Time])

RW

QVCJDN said:
I'm trying to pull just the date from the front of a date/time field. I'm
currently using the Left function "Date In: Left([Date Time],10)", but since
my date/time field has no place holders (e.g. 9/9/2005 appears, not
09/09/2005), between January and October I've been changing the the function
to 9 characters (or else my formula picks up the first digit of the time). Is
there a better way? Perhaps pull the characters from the left of the date and
count left from there? My Data looks like this: "9/9/2005 01:25:30"

Thanks, Dave
 
Hi,


Definitively. What about Day(), Month() and Year() as in:



Month( CDate( myDateAsAString ) )



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top