convert datetime to text

  • Thread starter Thread starter Student
  • Start date Start date
Student said:
is there a function in access like this
convert(varchar,mydatetimefield,120)

Both the Format() and CStr() functions will do this. However, neither will
specify a length for the result.
 
Both the Format() and CStr() functions will do this. However, neither
will specify a length for the result.

Surely Format$(SomeDate, "yyyy-mm-dd") is always exactly ten characters
long?


Tim F
 
Tim Ferguson said:
Surely Format$(SomeDate, "yyyy-mm-dd") is always exactly ten characters
long?

The OP was looking for an equivalent to
convert(varchar,mydatetimefield,120). In SQL Server when you convert a
date to a string like this you specify a length for the "converted to"
VarChar field. I was just pointing out that using the Access conversion
functions the field length will just be whatever the longest output value
is (not a length that he specifies in the function).
 
Back
Top