>Hi there,
>
>I'm working on an application written in VFP 7.0.
>
>I have a class object form for user input, in which the fields can be set up (at runtime) to accept Date, time, char, or logical data, depending on what my app specifies when the user input form is created using CREATEOBJECT. It's working fine. My problem is that I'm returning a date from one field and a time from another one. The date's type is Date and the time's type is Char. I need to use those values to query data in my FoxPro database, and would like to easily concatenate the date and time to make a valid datetime to use in my query.
>
>Any ideas on a quick way to do this?
I don't know whether this is "quick" enough; or whether there is a better method. But you can create a datetime value with the datetime() function.
Assuming your time is in a format like:
02:15:15
or
2:15:15
you might use:
MyDateTimeValue = datetime(year(MyDate), month(MyDate), day(MyDate),;
val(left(MyTime, 2)), val(substr(MyTime, 4, 2)), val(substr(MyTime, 7, 2)))
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)