Sep 21, 2001 #1 aabob MIS Sep 21, 2001 3 US Pardon the newbie question, but how do I convert a date to a string in my VBA code for the purpose of evaluation? Foxpro uses 'DTC' but I can find the VBA way. Thanks.
Pardon the newbie question, but how do I convert a date to a string in my VBA code for the purpose of evaluation? Foxpro uses 'DTC' but I can find the VBA way. Thanks.
Sep 21, 2001 #2 nickjar2 Programmer Jun 20, 2001 778 US I think maybe cStr, although when I haven't got access/vba in front of me my mind goes blank and I tend to give wrong answers. Nick Upvote 0 Downvote
I think maybe cStr, although when I haven't got access/vba in front of me my mind goes blank and I tend to give wrong answers. Nick
Sep 24, 2001 #3 ide Programmer Apr 10, 2001 236 EU Syntax Format(expression[, format[, firstdayofweek[, firstweekofyear]]]) '*********************************************************************** Dim MyTime, MyDate, MyStr MyTime = #17:04:23# MyDate = #January 27, 1993# ' Returns current system time in the system-defined long time format. MyStr = Format(Time, "Long Time" ' Returns current system date in the system-defined long date format. MyStr = Format(Date, "Long Date" MyStr = Format(MyTime, "h:m:s" ' Returns "17:4:23". MyStr = Format(MyTime, "hh:mm:ss AMPM" ' Returns "05:04:23 PM". MyStr = Format(MyDate, "dddd, mmm d yyyy" ' Returns "Wednesday, Jan 27 1993" ide Upvote 0 Downvote
Syntax Format(expression[, format[, firstdayofweek[, firstweekofyear]]]) '*********************************************************************** Dim MyTime, MyDate, MyStr MyTime = #17:04:23# MyDate = #January 27, 1993# ' Returns current system time in the system-defined long time format. MyStr = Format(Time, "Long Time" ' Returns current system date in the system-defined long date format. MyStr = Format(Date, "Long Date" MyStr = Format(MyTime, "h:m:s" ' Returns "17:4:23". MyStr = Format(MyTime, "hh:mm:ss AMPM" ' Returns "05:04:23 PM". MyStr = Format(MyDate, "dddd, mmm d yyyy" ' Returns "Wednesday, Jan 27 1993" ide