General information
Category:
Visual FoxPro and .NET
>>>>How can I determine whether a date is DMY or MDY? For instance, if I have a date that is formatted as follows: 01/02/48
>>>>The field in my table is a date of birth field and is a character field. Does anyone have any code written that will tell me whether the 01 is a month or a day. The same goes for the 02 portion of the field.
>>>
>>>Why the DOB field is a character in your table? And how was it populated? Did it come from your form or from some external data?
>>>
>>>You may try to cast to the date field in the select statement in the try/catch block. If select fails, try switching the set date and re-try.
>>
>>And if it succeeds ? :-}
>
>If it succeeds, you will know that in this particular file all dates can be represented in MDY format.
If might succeed because there were no days > 12 .......
>It does not 100% guarantee that the dates are in MDY. Selecting max(left(myDate,2)) is actually a better and simpler idea.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only