Convert Date to Text

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

Guest

Hi...want to combine two fields one text and one date...cant do it so I
figure i should convert the date to a text field...then join. Anyone know
which function I should use...not using VBA, functions within the query.

Thanks so much!

Tony
 
Is that suppossed to be funny? However, I did find the Function you refer to
-- CStr.

Thanks,

Tony
 
It was not intended to be a joke.

Format(Date, "yyyymmdd"), run today, will return a string 20070208

Format(Date, "mmddyyyy"), run today, will return a string 02082007

Format(Date, "mm\/dd\/yyyy"), run today, will return a string 02/08/2007 (if
you just put mm/dd/yyyy, you can't be sure whether it'll use / as a
separator: it actually uses whatever the Date Separator character has been
defined as in Regional Settings)

Format(Date, "m\/d\/yyyy"), run today, will return a string 2/8/2007

The problem with using CStr is that you cannot be certain whether it'll
return 2/8/2007, 02/08/2007 or something else: it depends on the user's
Short Date format, as set through Regional Settings.
 
Hi...want to combine two fields one text and one date...cant do it so I
figure i should convert the date to a text field...then join. Anyone know
which function I should use...not using VBA, functions within the query.

Thanks so much!

Tony
[TextField] = "Your payment is due on"
[DateField] = 2/8/2007 (as a date datatype)

In your query grid....

CombinedFields:[TextField] & " " & Format([DateField],"mmmm d, yyyy")

"Your payment is due on February 8, 2007"
 
Doug was being helpful. not funny.
Look up the Format function in VBA Help, it is the proper
way to do it. CStr will format anything to text, but it
only uses a generic format that can vary from one locale to
another.
 
Back
Top