Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Format dates in a grid

518 views
Skip to first unread message

Mike W

unread,
Sep 11, 2008, 3:07:01 PM9/11/08
to
How do you format a date time field so that just the date displays in the
cell as mm/dd/yyyy? I've tried setting the format property for both the
column and text box to MDY and also tried D. I've set the DateFormat
property of the textbox to 10-MDY. I've tried setting sparse to both F and
T. No matter what I do, the time is also showing up in the cell with the
date.

Fred Taylor

unread,
Sep 11, 2008, 8:57:33 PM9/11/08
to
If what you've got is a DateTime field, you'll see that in the grid. Sounds
like you should make the Column.ControlSource be ="TTOD(YourField)" and also
set the column.Sparse to .F.. Note that this will make the column ReadOnly,
so if you're using the grid for data entry, you'll have to create a date
type field and use that.

--
Fred
Microsoft Visual FoxPro MVP


"Mike W" <Mi...@discussions.microsoft.com> wrote in message
news:21E3E80B-8783-45B5...@microsoft.com...

Mike W

unread,
Sep 12, 2008, 8:52:07 AM9/12/08
to
Unfortunately the field is in a SQL table so I can't make it a date only field.

Bernhard Sander

unread,
Sep 12, 2008, 10:06:03 AM9/12/08
to
Hi Mike,

> Unfortunately the field is in a SQL table so I can't make it a date only field.

In a remote view you can redefine this field so that (only) within foxpro it is
treated as date field. See "Properties" on the "Field" tab in the view designer.

Regards
Bernhard Sander

0 new messages